Player.java (386B)
1 package Monster; 2 3 /** 4 * Class for the player 5 */ 6 public class Player { 7 private int money; 8 private int hp; 9 private int damage; 10 11 public int getMoney() { 12 return money; 13 } 14 15 public void setMoney(int newMoney) { 16 money = newMoney; 17 } 18 19 public int getHp() { 20 return hp; 21 } 22 23 public void setHp(int newHp) { 24 hp = newHp; 25 } 26 27 public void hitMonster(Monster m) { 28 m.hit(damage); 29 } 30 }