-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEnemy.java
More file actions
44 lines (33 loc) · 844 Bytes
/
Enemy.java
File metadata and controls
44 lines (33 loc) · 844 Bytes
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
package factory;
/**
* @author Khalid Elshafie <abolkog@gmail.com>
* @created 08/03/2018.
*/
public abstract class Enemy {
private String name;
private int damage;
private int health;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getDamage() {
return damage;
}
public void setDamage(int damage) {
this.damage = damage;
}
public int getHealth() {
return health;
}
public void setHealth(int health) {
this.health = health;
}
public void showUp() {
System.out.printf("[%s] is showing up. Damage is [%d] Health is [%d]%n", getName(), getDamage(), getHealth());
}
public abstract int attack() ;
public abstract void takeDamage(int value) ;
}