-
Notifications
You must be signed in to change notification settings - Fork 0
/
Property.java
51 lines (41 loc) · 1006 Bytes
/
Property.java
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
import java.util.Scanner;
public class Property {
private String name;
private int index;
boolean Continue = true;
private Player Owner = new Player("Bank");
public Player getOwner() {
return Owner;
}
public void setOwner(Player owner) throws LowBalance {
Owner = owner;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
Property(String name, int index){
this.index = index;
this.name = name;
}
Scanner input = new Scanner(System.in);
}
class LowBalance extends Exception{
public LowBalance(Player player) {
super("You do not have enough money");
player.lowBalance = true;
}
}
class WrongInput extends Exception{
public WrongInput() {
super("Wrong input! try again");
}
}