-
Notifications
You must be signed in to change notification settings - Fork 0
/
Militant.java
41 lines (34 loc) · 878 Bytes
/
Militant.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
/**
* Minimum functionality for entities that can engage in fights.
* @author Johnson Zhou 1302442 <[email protected]>
*/
interface Militant<T extends GameCharacter> {
/**
* Sets the maximum health value
* @param maxHealth
*/
public void setMaxHealth(int maxHealth);
/**
* Restores the health value back to maximum
*/
public void restoreHealth();
/**
* Sets the damage value that can be applied to others
* @param damage
*/
public void setDamage(int damage);
/**
* Gets the previously set damage value
* @return damage value as int
*/
public int getDamage();
/**
* Attacks another Militant object
*/
public boolean attacks(T foe);
/**
* Reduces the health value of self by applying the specified damage value
* @param damage
*/
public int receiveDamage(int damage);
}