forked from peterParker79/java-ironbattle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacter.java
More file actions
60 lines (44 loc) · 960 Bytes
/
Character.java
File metadata and controls
60 lines (44 loc) · 960 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import java.util.UUID;
public class Character {
private String id;
private String name;
private int hp;
private boolean isAlive;
public Character(String name, int hp) {
setName(name);
setHp(hp);
setId();
setAlive(true);
}
public Character(String name) {
setName(name);
setId();
setAlive(true);
}
public String getId() {
return id;
}
private void setId() {
this.id = UUID.randomUUID().toString();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getHp() {
return hp;
}
public void setHp(int hp) {
this.hp = hp;
}
public boolean isAlive() {
return isAlive;
}
public void setAlive(boolean alive) {
isAlive = alive;
}
public void attack(Character character) {
}
}