-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacter.java
More file actions
113 lines (106 loc) · 1.92 KB
/
Character.java
File metadata and controls
113 lines (106 loc) · 1.92 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
package mockTextGameProject;
public abstract class Character
{
private String name;
private int maxHealthPoints;
private int attackValue;
private int currentHealth;
private int currentRoom;
/**
* @return the currentRoom
*/
public int getCurrentRoom()
{
return currentRoom;
}
/**
* @param currentRoom the currentRoom to set
*/
public void setCurrentRoom(int currentRoom)
{
this.currentRoom = currentRoom;
}
/**
* @return the currentHealth
*/
public int getCurrentHealth()
{
return currentHealth;
}
/**
* @param currentHealth the currentHealth to set
*/
public void setCurrentHealth(int currentHealth)
{
this.currentHealth = currentHealth;
}
/**
* @return the attackValue
*/
public int getAttackValue()
{
return attackValue;
}
/**
* @param attackValue the attackValue to set
*/
public void setAttackValue(int attackValue)
{
this.attackValue = attackValue;
}
/**
* @return the maxHealthPoints
*/
public int getMaxHealthPoints()
{
return maxHealthPoints;
}
/**
* @param maxHealthPoints the maxHealthPoints to set
*/
public void setMaxHealthPoints(int maxHealthPoints)
{
this.maxHealthPoints = maxHealthPoints;
}
/**
* @return the name
*/
public String getName()
{
return name;
}
/**
* @param name the name to set
*/
public void setName(String name)
{
this.name = name;
}
/**
* @return the healthPoints
*/
public boolean isAlive()
{
return this.currentHealth > 0;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString()
{
return "Character [name=" + name + ", maxHealthPoints=" + maxHealthPoints + ", attackValue=" + attackValue
+ ", currentHealth=" + currentHealth + ", currentRoom=" + currentRoom + "]";
}
/*
* if(player.getCurrentRoom == monster.getCurrentRoom)
* {
* while(player.isAlive() && monster.isAlive())
* {
* //commence Attack
*
* }
*
* }
*/
}