Package com.csse3200.game.services
Class GameEndService
java.lang.Object
com.csse3200.game.services.GameEndService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the Engineer Count UI componentint
Returns the number of engineers leftboolean
Returns the game over statevoid
setEngineerCount
(int newLimit) Set the engineer limit.void
Updates engineer count and the UI display If engineer count is 0, the game is over.
-
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
Returns the Engineer Count UI component
-