Advertisement
ilianrusev

gladiator

Jun 22nd, 2019
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package arena;
  2.  
  3. public class Gladiator {
  4. private String name;
  5. private Stat stat;
  6. private Weapon weapon;
  7.  
  8. public Gladiator(String name, Stat stat, Weapon weapon) {
  9. this.name = name;
  10. this.stat = stat;
  11. this.weapon = weapon;
  12. }
  13.  
  14. public String getName() {
  15. return name;
  16. }
  17.  
  18. public int getStatPower() {
  19. int power = this.stat.getAgility()
  20. + this.stat.getFlexibility()
  21. + this.stat.getIntelligence()
  22. + this.stat.getSkills()
  23. + this.stat.getStrength();
  24.  
  25. return power;
  26. }
  27.  
  28. public int getWeaponPower() {
  29. int power = this.weapon.getSharpness()
  30. + this.weapon.getSize()
  31. + this.weapon.getSolidity();
  32.  
  33. return power;
  34. }
  35.  
  36. public int getTotalPower() {
  37. return getWeaponPower() + getStatPower();
  38. }
  39.  
  40. @Override
  41. public String toString() {
  42. return getName() + " – " + getTotalPower() +
  43. " Weapon Power: " + getWeaponPower() +
  44. " Stat Power: " + getStatPower();
  45.  
  46. }
  47. }
Advertisement
RAW Paste Data Copied
Advertisement