-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.java
104 lines (97 loc) · 2.12 KB
/
Player.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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*|||||||||||||||||||||||||||||||||||||||||||
PLAYER CLASS
Implements Character so that the player has
the same stats as the rest of the family
Contains all of the variables for the
supplies as well as accessor and mutator
methods to those variables
|||||||||||||||||||||||||||||||||||||||||*/
public class Player extends Character {
//========================
//===Instance Variables===
//========================
private int food;
private int ammo;
private int wheels;
private int axles;
private int tongues;
private int money;
private int difficulty;
//==================
//===Constructors===
//==================
public Player() {
HP = 100;
condition = 0;
}
public Player(String x) {
this();
name = x;
}
//======================
//===Accessor Methods===
//======================
public int getFood() {
return food;
}
public int getAmmo() {
return ammo;
}
public int getWheels() {
return wheels;
}
public int getAxles() {
return axles;
}
public int getTongues() {
return tongues;
}
public int getMoney() {
return money;
}
//=====================
//===Mutator Methods===
//=====================
public void addFood( int input ) {
food += input;
}
public void addAmmo( int input ) {
ammo += input;
}
public void addWheels( int input ) {
wheels += input;
}
public void addAxles( int input ) {
axles += input;
}
public void addTongues( int input ) {
tongues += input;
}
public void addMoney( int input ) {
money += input;
}
public void subFood( int input ) {
food -= input;
}
public void subAmmo( int input ) {
ammo -= input;
}
public void subWheels( int input ) {
wheels -= input;
}
public void subAxles( int input ) {
axles -= input;
}
public void subTongues( int input ) {
tongues -= input;
}
public void subMoney( int input ) {
money -= input;
}
public void setName( String input ) {
name = input;
}
public void setMoney( int input ) {
money = input;
}
}