source: lost-haven/main/Creature.java@ 0870468

Last change on this file since 0870468 was 0870468, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 4 years ago

Move all global classes into the main package

  • Property mode set to 100644
File size: 3.8 KB
Line 
1package main;
2
3import java.awt.image.*;
4
5public class Creature {
6 private String name;
7 private CreatureType type;
8 private BufferedImage img;
9 private Gender gender;
10 private int level;
11 private Point loc;
12 private int speed;
13 private long lastMoved;
14 private int attackSpeed;
15 private int damage;
16 private long lastAttacked;
17 private int strength;
18 private int dexterity;
19 private int constitution;
20 private int charisma;
21 private int wisdom;
22 private int intelligence;
23 private int hitpoints;
24 private int manapoints;
25 private int maxHitpoints;
26 private int maxManapoints;
27
28 public Creature() {
29 name = "";
30 gender = Gender.None;
31 loc = new Point(0, 0);
32 }
33
34 public Creature(String name) {
35 this.name = name;
36 loc = new Point(0, 0);
37 }
38
39 public Creature(String name, Gender gender) {
40 this.name = name;
41 this.gender = gender;
42 loc = new Point(0, 0);
43 }
44
45 public int getAttackSpeed() {
46 return attackSpeed;
47 }
48
49 public int getCharisma() {
50 return charisma;
51 }
52
53 public int getConstitution() {
54 return constitution;
55 }
56
57 public int getDamage() {
58 return damage;
59 }
60
61 public int getDexterity() {
62 return dexterity;
63 }
64
65 public Gender getGender() {
66 return gender;
67 }
68
69 public int getHitpoints() {
70 return hitpoints;
71 }
72
73 public BufferedImage getImg() {
74 return img;
75 }
76
77 public int getIntelligence() {
78 return intelligence;
79 }
80
81 public long getLastAttacked() {
82 return lastAttacked;
83 }
84
85 public long getLastMoved() {
86 return lastMoved;
87 }
88
89 public int getLevel() {
90 return level;
91 }
92
93 public Point getLoc() {
94 return loc;
95 }
96
97 public int getManapoints() {
98 return manapoints;
99 }
100
101 public int getMaxHitpoints() {
102 return maxHitpoints;
103 }
104
105 public int getMaxManapoints() {
106 return maxManapoints;
107 }
108
109 public String getName() {
110 return name;
111 }
112
113 public int getSpeed() {
114 return speed;
115 }
116
117 public int getStrength() {
118 return strength;
119 }
120
121 public CreatureType getType() {
122 return type;
123 }
124
125 public int getWisdom() {
126 return wisdom;
127 }
128
129 public void setAttackSpeed(int attackSpeed) {
130 this.attackSpeed = attackSpeed;
131 }
132
133 public void setCharisma(int charisma) {
134 this.charisma = charisma;
135 }
136
137 public void setConstitution(int constitution) {
138 this.constitution = constitution;
139 }
140
141 public void setDamage(int damage) {
142 this.damage = damage;
143 }
144
145 public void setDexterity(int dexterity) {
146 this.dexterity = dexterity;
147 }
148
149 public void setGender(Gender gender) {
150 this.gender = gender;
151 }
152
153 public void setHitpoints(int hitpoints) {
154 this.hitpoints = hitpoints;
155 }
156
157 public void setImg(BufferedImage img) {
158 this.img = img;
159 }
160
161 public void setIntelligence(int intelligence) {
162 this.intelligence = intelligence;
163 }
164
165 public void setLastAttacked(long lastAttacked) {
166 this.lastAttacked = lastAttacked;
167 }
168
169 public void setLastMoved(long lastMoved) {
170 this.lastMoved = lastMoved;
171 }
172
173 public void setLevel(int level) {
174 this.level = level;
175 }
176
177 public void setLoc(Point loc) {
178 this.loc = loc;
179 }
180
181 public void setManapoints(int manapoints) {
182 this.manapoints = manapoints;
183 }
184
185 public void setMaxHitpoints(int maxHitpoints) {
186 this.maxHitpoints = maxHitpoints;
187 }
188
189 public void setMaxManapoints(int maxManapoints) {
190 this.maxManapoints = maxManapoints;
191 }
192
193 public void setName(String name) {
194 this.name = name;
195 }
196
197 public void setSpeed(int speed) {
198 this.speed = speed;
199 }
200
201 public void setStrength(int strength) {
202 this.strength = strength;
203 }
204
205 public void setType(CreatureType type) {
206 this.type = type;
207 }
208
209 public void setWisdom(int wisdom) {
210 this.wisdom = wisdom;
211 }
212
213 public String toString() {
214 return name;
215 }
216
217 public boolean equals(Object c) {
218 return name.trim().equals(((Creature)c).name.trim());
219 }
220}
Note: See TracBrowser for help on using the repository browser.