-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAUnit.java
More file actions
executable file
·59 lines (57 loc) · 1.03 KB
/
AUnit.java
File metadata and controls
executable file
·59 lines (57 loc) · 1.03 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
public abstract class AUnit {
String type;
int attack;
int health;
int defense;
String SpecialAbility;
int moves;
int cost;
public AUnit(int a, int d, int h, String t, String s, int c){
setAttack(a);
setDefense(d);
setHealth(h);
type = t;
setAbility(s);
moves = 1;
cost = c;
}
public void resetMoves(){
moves = 1;
}
public int getCost(){
return cost;
}
public void reduceMoves(){
moves--;
}
public int getMoves(){
return moves;
}
public void setAttack(int a){
attack = a;
}
public int getAttack(){
return attack;
}
public void setDefense(int d){
defense = d;
}
public int getDefense(){
return defense;
}
public void setHealth(int h){
health = h;
}
public int getHealth(){
return health;
}
public void setAbility(String s){
SpecialAbility = s;
}
public String getAbility(){
return SpecialAbility;
}
public String getType(){
return type;
}
}