-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPeople.java
More file actions
executable file
·131 lines (100 loc) · 2.36 KB
/
People.java
File metadata and controls
executable file
·131 lines (100 loc) · 2.36 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package Project02;
import Project02.PeopleType;
public abstract class People
{
private String personName;
private String myNation;
private String myTribe;
private PeopleType me;
protected String myDescription;
private int myLifePoints;
private boolean dead;
/**
* This class allow you to manage who exactly is fighting who through out the
* game.
* So this help you give the names of each nation, tribe, and people type.
* @param nation
* @param tribe
* @param person
* @param lifePoints
*/
public People(String nation, String tribe, PeopleType person, int lifePoints)
{
myNation = nation;
myTribe = tribe;
me = person;
myDescription = me.getDescription();
myLifePoints = lifePoints;
dead = false;
}
/**
* This method allows you to set dead equal to true.
*/
public void setDead()
{
dead = true;
}
/**
* This method allows you to see if the someone
* is dead.
* @return dead
*/
public boolean getDead()
{
return dead;
}
/**
* Get the type of person within the tribe.
* @return me
*/
public PeopleType getType()
{
return me;
}
/**
* Get the name of the tribe
* @return the tribe
*/
public String getTribe()
{
return myTribe;
}
/**
* Get the name of the nation
* @return the nation
*/
public String getNation()
{
return myNation;
}
/**
* This method establish if the person has any life points
* @return if the person is alive or not.
*/
public Boolean isPersonAlive()
{
return (myLifePoints > 0);
}
/**
* This method establish the life points
* @return the life points
*/
public int getLifePoints()
{
return myLifePoints;
}
/**
* This methods allows you to moditify the life points as the game progress
* @param points
*/
public void modifyLifePoints(int points)
{
myLifePoints += points;
}
public abstract int encounterStrategy(People otherPerson);
public String toString()
{
String result = new String( myNation + "\t" + myTribe + "\t" + me + "\t" + myDescription + "\t" + myLifePoints);
return result;
}
}