-
Notifications
You must be signed in to change notification settings - Fork 1
/
LightCavalry.java
80 lines (67 loc) · 1.35 KB
/
LightCavalry.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
package BattleSimulator;
public class LightCavalry extends BasicUnit
{
private final String HIGHEST = "Cavalry Archers";
private final String HIGH = "Archers";
private final String NEUTRAL = "Heavy Cavalry";
private final String LOW = "Spearmen";
private final String LOWEST = "Infantry";
private final String DEFEND1 = "Infantry";
private final String DEFEND2 = "Spearmen";
private static int userCounter;
private static int computerCounter;
private int unitNumber;
private static String referenceName;
public LightCavalry(String name)
{
super(name);
if (userCounter == 0)
referenceName = name;
if (name.equals(referenceName))
{
userCounter++;
unitNumber = userCounter;
}
else
{
computerCounter++;
unitNumber = computerCounter;
}
}
public String getName()
{
return displayArmyName() + " Light Cavalry " + unitNumber;
}
public String getType()
{
return "Light Cavalry";
}
public String getHighest()
{
return HIGHEST;
}
public String getHigh()
{
return HIGH;
}
public String getNeutral()
{
return NEUTRAL;
}
public String getLow()
{
return LOW;
}
public String getLowest()
{
return LOWEST;
}
public String getDefend1()
{
return DEFEND1;
}
public String getDefend2()
{
return DEFEND2;
}
}