12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package pathgame.gameplay;
- /**
- * A container for holding an energy cost from the step of the player with a
- * lifetime for showing in the HUD
- *
- * @author julia
- */
- public class MinusStepsValues
- {
- private final int minusValue;
- private int lifeTime = 0;
- /**
- * Contructor initializing a new energyCost with a lifetime
- *
- * @param minusValue energyCost of a step of the player
- */
- public MinusStepsValues(int minusValue)
- {
- this.minusValue = minusValue;
- }
- /**
- * Returns the energyCost value
- *
- * @return energyCost value
- */
- public int getValue()
- {
- return minusValue;
- }
- /**
- * Returns the energyCost lifetime
- *
- * @return energyCost lifetime
- */
- public int getLifeTime()
- {
- return lifeTime;
- }
- /**
- * Recalculates the lifetime every gametick and returns if energyCost is
- * still alive
- *
- * @return if energyCost is still alive
- */
- public boolean tick()
- {
- lifeTime++;
- return lifeTime >= 10;
- }
- }
|