-
Notifications
You must be signed in to change notification settings - Fork 0
/
Character.java
50 lines (40 loc) · 953 Bytes
/
Character.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
package activity;
public class Character {
private String name;
private String gender;
private String type;
private int power;
private int health;
public Character(String name, String gender, String type, int power, int health) {
this.name = name;
this.gender = gender;
this.type = type;
this.power = power;
this.health = health;
}
public String getName() {
return name;
}
public String getGender() {
return gender;
}
public String getType() {
return type;
}
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;
}
}