Class GameEndService

java.lang.Object
com.csse3200.game.services.GameEndService

public class GameEndService extends Object
  • Constructor Details

    • GameEndService

      public GameEndService()
      Constructor for the Game End Service
  • Method Details

    • setEngineerCount

      public void setEngineerCount(int newLimit)
      Set the engineer limit. During instantiation, limit defaults to 5.
      Parameters:
      newLimit - as an integer representing the maximum number of engineer deaths
    • getEngineerCount

      public int getEngineerCount()
      Returns the number of engineers left
      Returns:
      (int) engineer count
    • updateEngineerCount

      public void updateEngineerCount()
      Updates engineer count and the UI display If engineer count is 0, the game is over.
    • hasGameEnded

      public boolean hasGameEnded()
      Returns the game over state
      Returns:
      (boolean) true if the game is over; false otherwise
    • getDisplay

      public EngineerCountDisplay getDisplay()
      Returns the Engineer Count UI component