-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.java
155 lines (150 loc) · 3.04 KB
/
Player.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import java.util.*;
import java.lang.*;
public class Player implements Comparable<Player>
{
private int sackson,zeta,hydra,fusion,america,phoenix,quantum;
private int money;
private Tile[] tiles;
private boolean isAI;
public Player(Tile[] tiles)
{
this.tiles = tiles;
money=6000;
sackson=0;
zeta=0;
hydra=0;
fusion=0;
america=0;
phoenix=0;
quantum=0;
isAI = false;
}
public void changeThisCompany(Companies c,int x)
{
if(c instanceof Sackson)sackson+=x;
else if(c instanceof Zeta)zeta+=x;
else if(c instanceof America)america+=x;
else if(c instanceof Hydra)hydra+=x;
else if(c instanceof Fusion)fusion+=x;
else if(c instanceof Quantum)quantum+=x;
else if(c instanceof Phoenix)phoenix+=x;
}
public int getCompanyCount(Companies c)
{
if(c instanceof Sackson)return sackson;
else if(c instanceof Zeta)return zeta;
else if(c instanceof America)return america;
else if(c instanceof Hydra)return hydra;
else if(c instanceof Fusion)return fusion;
else if(c instanceof Quantum)return quantum;
else if(c instanceof Phoenix)return phoenix;
return 0;
}
public Tile[] getTiles()
{
return tiles;
}
public void set$(int x)
{
money=x;
}
public void change$(int x)
{
money+=x;
}
public int get$()
{
return money;
}
public int getSackson()
{
return sackson;
}
public int getZeta()
{
return zeta;
}
public int getHydra()
{
return hydra;
}
public int getFusion()
{
return fusion;
}
public int getAmerica()
{
return america;
}
public int getPhoenix()
{
return phoenix;
}
public int getQuantum()
{
return quantum;
}
public void changeSackson(int x)
{
sackson+=x;
}
public void changeZeta(int x)
{
zeta+=x;
}
public void changeHydra(int x)
{
hydra+=x;
}
public void changeFusion(int x)
{
fusion+=x;
}
public void changeAmerica(int x)
{
america+=x;
}
public void changePhoenix(int x)
{
phoenix+=x;
}
public void changeQuantum(int x)
{
quantum+=x;
}
public void setTile(int x,Tile t)
{
tiles[x] = t;
}
public Tile useTile(int x)
{
return tiles[x];
}
public void setAI(boolean b)
{
isAI = b;
}
public boolean isAI()
{
return isAI;
}
public int compareTo(Player x)
{
if(x.get$()>money)return -1;
else if(x.get$()<money)return 1;
return 0;
}
public String toString()
{
if(isAI)return "SOME AI";
else return "THE PLAYER";
}
public int getNetWealth(int s1,int z1, int h1, int f1, int a1, int q1, int p1)
{
return s1*getSackson()+z1*getZeta()+h1*getHydra()+f1*getFusion()+a1*getAmerica()+q1*getQuantum()+p1*getPhoenix();
}
public String getInfo(int s1, int z1, int h1,int f1, int a1, int q1, int p1)
{
return "Money Left: "+get$()+"\n"+"Sackson: "+getSackson()+"\n"+"Zeta: "+getZeta()+"\n"+"Hydra: "+getHydra()+"\n"+"Fusion: "+getFusion()+"\n"+"America: "+getAmerica()+"\n"+"Quantum: "+getQuantum()+"\n"+"Phoenix: "+getPhoenix()+"\n"+"Net Wealth: "+getNetWealth(s1,z1,h1,f1,a1,q1,p1);
}
}