-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlayer.java
More file actions
62 lines (37 loc) · 1.38 KB
/
Player.java
File metadata and controls
62 lines (37 loc) · 1.38 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
public class Player { //Constructor
private int borrow; //Borrowings from Bank (500K-1M Max 4M)
private int balance; //Running Balance...amount of cash they currently hold
private int id; //Which Player?
private static int numberOfPlayers = 0;
public Player(int startBorrow, int startBalance) { //constructor
borrow = startBorrow;
balance = startBalance;
id = ++numberOfPlayers;
}
public Player(int startBorrow) { //constructor
borrow = startBorrow;
id = ++numberOfPlayers;
}
public Player() { //constructor
id = ++numberOfPlayers;
}
public int getID() { //Player 1, 2 or 3 etc.
return id;
}
public static int getNumberOfPlayers() {
return numberOfPlayers;
}
public int getBorrow() {
return borrow;
}
public void setBorrow(int newValue) {
borrow = newValue;
}
public int getBalance() {
return balance;
}
public void setBalance(int newValue) {
balance = newValue;
}
// System.out.println(Player.2String());
}