PlayerAbilities.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. package pathgame.gameplay;
  2. /**
  3. * A container for holding all player abilities
  4. *
  5. * @author julia
  6. */
  7. public class PlayerAbilities
  8. {
  9. private final String name;
  10. private final int fasterGrass;
  11. private final int fasterForest;
  12. private final int fasterShallowWater;
  13. private final int fasterDeepWater;
  14. private final int fasterHill;
  15. private final int fasterMountain;
  16. private final int fasterSwamp;
  17. /**
  18. * Contructor initializing new player abilities
  19. *
  20. * @param name name of the character type with this specific abilities
  21. * @param fasterGrass the energyCostsPoints the player can move faster on
  22. * grass tiles
  23. * @param fasterForest the energyCostsPoints the player can move faster on
  24. * forest tiles
  25. * @param fasterShallowWater the energyCostsPoints the player can move
  26. * faster on shallow water tiles
  27. * @param fasterDeepWater the energyCostsPoints the player can move faster
  28. * on deep water tiles
  29. * @param fasterHill the energyCostsPoints the player can move faster on
  30. * hill tiles
  31. * @param fasterMountain the energyCostsPoints the player can move faster on
  32. * mountain tiles
  33. * @param fasterSwamp the energyCostsPoints the player can move faster on
  34. * swamp tiles
  35. */
  36. public PlayerAbilities(String name, int fasterGrass, int fasterForest, int fasterShallowWater,
  37. int fasterDeepWater, int fasterHill, int fasterMountain, int fasterSwamp)
  38. {
  39. this.name = name;
  40. this.fasterGrass = fasterGrass;
  41. this.fasterForest = fasterForest;
  42. this.fasterShallowWater = fasterShallowWater;
  43. this.fasterDeepWater = fasterDeepWater;
  44. this.fasterHill = fasterHill;
  45. this.fasterMountain = fasterMountain;
  46. this.fasterSwamp = fasterSwamp;
  47. }
  48. public final static PlayerAbilities NORMAL = new PlayerAbilities("Normal", 0, 0, 0, 0, 0, 0, 0);
  49. public final static PlayerAbilities HIKER = new PlayerAbilities("Hiker", 0, 0, 0, 0, 2, 4, 0);
  50. public final static PlayerAbilities HUNTER = new PlayerAbilities("Hunter", 0, 1, 0, 0, 0, 0, 1);
  51. public final static PlayerAbilities SWIMMER = new PlayerAbilities("Swimmer", 0, 0, 3, 0, 0, 0, 0);
  52. public final static PlayerAbilities SAILOR = new PlayerAbilities("Sailor", 0, 0, 0, 1, 0, 0, 0);
  53. /**
  54. * Array of all character types
  55. */
  56. public final static PlayerAbilities[] ABILITIES = new PlayerAbilities[]
  57. {
  58. NORMAL, HIKER, HUNTER, SWIMMER, SAILOR
  59. };
  60. /**
  61. * Returns the energyCostPoints the player is faster on grass tiles
  62. *
  63. * @return the energyCostPoints the player is faster on grass tiles
  64. */
  65. public int getFasterGrass()
  66. {
  67. return fasterGrass;
  68. }
  69. /**
  70. * Returns the energyCostPoints the player is faster on forest tiles
  71. *
  72. * @return the energyCostPoints the player is faster on forest tiles
  73. */
  74. public int getFasterForest()
  75. {
  76. return fasterForest;
  77. }
  78. /**
  79. * Returns the energyCostPoints the player is faster on shallow water tiles
  80. *
  81. * @return the energyCostPoints the player is faster on shallow water tiles
  82. */
  83. public int getFasterShallowWater()
  84. {
  85. return fasterShallowWater;
  86. }
  87. /**
  88. * Returns the energyCostPoints the player is faster on deep water tiles
  89. *
  90. * @return the energyCostPoints the player is faster on deep water tiles
  91. */
  92. public int getFasterDeepWater()
  93. {
  94. return fasterDeepWater;
  95. }
  96. /**
  97. * Returns the energyCostPoints the player is faster on hill tiles
  98. *
  99. * @return the energyCostPoints the player is faster on hill tiles
  100. */
  101. public int getFasterHill()
  102. {
  103. return fasterHill;
  104. }
  105. /**
  106. * Returns the energyCostPoints the player is faster on mountain tiles
  107. *
  108. * @return the energyCostPoints the player is faster on mountain tiles
  109. */
  110. public int getFasterMountain()
  111. {
  112. return fasterMountain;
  113. }
  114. /**
  115. * Returns the energyCostPoints the player is faster on swamp tiles
  116. *
  117. * @return the energyCostPoints the player is faster on swamp tiles
  118. */
  119. public int getFasterSwamp()
  120. {
  121. return fasterSwamp;
  122. }
  123. /**
  124. * Returns the name of the current character type
  125. *
  126. * @return the name of the current character type
  127. */
  128. public String getName()
  129. {
  130. return name;
  131. }
  132. }