Interface GameState

All Known Implementing Classes:
GameStateImpl

public interface GameState
This interface models a GameState. Works on the main information related to the game.
  • Method Details

    • incZombiesGenerated

      void incZombiesGenerated()
      Increases the number of Zombies generated.
    • incKilledZombies

      void incKilledZombies()
      Increases the number of Zombies killed.
    • incSunScore

      void incSunScore()
      Increases the sun points obtained.
    • decSunScore

      void decSunScore(int costPlant)
      Decrements the sun points.
      Parameters:
      costPlant - cost of the chosen plant.
    • getKilledZombies

      int getKilledZombies()
      Returns:
      number of Zombies killed.
    • getSunScore

      int getSunScore()
      Returns:
      sun points obtained.
    • getZombiesGenerated

      int getZombiesGenerated()
      Returns:
      number of Zombies generated.
    • areZombieAllKilled

      boolean areZombieAllKilled()
      Returns:
      if number of zombies killed is equals to the effective zombie number to be killed.
    • setWinState

      void setWinState(boolean winState)
      Sets the win state of the current game.
      Parameters:
      winState - the state of the current game.
    • getWinState

      Optional<Boolean> getWinState()
      Returns the win state at the end of the Game.
      Returns:
      true if player won, false if player lost, Optional.empty if game is not over.