-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson.java
More file actions
75 lines (36 loc) · 1012 Bytes
/
Person.java
File metadata and controls
75 lines (36 loc) · 1012 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
public class Person {
private String name;
private String job;
private int hitPoint;
private int maxDamage;
private int defenseAbility;
public Person(String name, String job, int hitPoint,int maxDamage, int defenseAbility ) {
this.name = name;
this.job = job;
this.hitPoint = hitPoint;
this.maxDamage = maxDamage;
this.defenseAbility = defenseAbility;
}
public String getName() {
return name;
}
public String getJob() {
return job;
}
public int getHitPoint() {
return hitPoint;
}
public int getMaxDamage() {
return maxDamage;
}
public int getDefenseAbility() {
return defenseAbility;
}
public int hpReduction (int damage){
hitPoint = (hitPoint-damage);
return hitPoint;
}
public String toString() {
return "My name is: " + name + "My job is: " + job + "HitPoint Damage: " + hitPoint + "Max Damage: " + maxDamage + "Defense Ability: " + defenseAbility;
}
}