-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBankAccount.swift
49 lines (38 loc) · 1.05 KB
/
BankAccount.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// BankAccount.swift
// a1bank
//
// Created by Panagiotis Papasyamatis on 10/05/2016.
// Copyright © 2016 Panagiotis Papastamatis. All rights reserved.
//
import Foundation
class BankAccount: Hashable {
var id: Int32
var balance: Double
var friendlyName: String
var currency: String
//The id of the user that owns this account
var owner: Int32
init(id: Int32, balance: Double, ownerId: Int32, friendName: String) {
self.id = id
self.balance = balance
self.owner = ownerId
self.friendlyName = friendName
self.currency = "AUD"
}
init(id: Int32, balance: Double, ownerId: Int32, friendName: String, currency: String) {
self.id = id
self.balance = balance
self.owner = ownerId
self.friendlyName = friendName
self.currency = currency
}
var hashValue: Int {
get {
return self.id.hashValue
}
}
}
func ==(lhs: BankAccount, rhs: BankAccount) -> Bool {
return lhs.id == rhs.id
}