-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnemy.java
More file actions
44 lines (35 loc) · 829 Bytes
/
Enemy.java
File metadata and controls
44 lines (35 loc) · 829 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 activity;
public class Enemy {
private String name;
private String species;
private int power;
private int health;
public Enemy(String name, String species, int power, int health) {
this.name = name;
this.species = species;
this.power = power;
this.health = health;
}
public String getName() {
return name;
}
public String getSpecies() {
return species;
}
public int getPower() {
return power;
}
public int getHealth() {
return health;
}
public void setPower(int power) {
this.power = power;
}
public void setHealth(int health) {
this.health = health;
}
public void updateHealth(int attack){
health -= attack;
this.health = health;
}
}