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