Package model.gameStates
Class MenuModel
java.lang.Object
model.gameStates.MenuModel
The MenuModel class represents the model for the menu state in the game.
It manages the different overlays and their states.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDecreases the selection index by one.Returns the MenuScoreBoardOverlayModel instance.Returns the MenuUserCreationOverlayModel instance.Returns the MenuUserSelectionOverlayModel instance.intReturns the current selection index.voidIncreases the selection index by one.booleanChecks if the score board overlay is active.booleanChecks if the user creation overlay is active.booleanChecks if the user selection overlay is active.voidsetScoreBoardOverlayActive(boolean scoreBoardOverlayActive) Sets the score board overlay active state.voidsetSelectionIndex(int selectionIndex) Sets the selection index.voidsetUserCreationOverlayActive(boolean userCreationOverlayActive) Sets the user creation overlay active state.voidsetUserSelectionOverlayActive(boolean userSelectionOverlayActive) Sets the user selection overlay active state.voidupdate()Updates the active overlay model.
-
Constructor Details
-
MenuModel
public MenuModel()Constructs a MenuModel and initializes the overlay models.
-
-
Method Details
-
update
public void update()Updates the active overlay model. -
setUserSelectionOverlayActive
public void setUserSelectionOverlayActive(boolean userSelectionOverlayActive) Sets the user selection overlay active state.- Parameters:
userSelectionOverlayActive- the new state of the user selection overlay
-
setUserCreationOverlayActive
public void setUserCreationOverlayActive(boolean userCreationOverlayActive) Sets the user creation overlay active state.- Parameters:
userCreationOverlayActive- the new state of the user creation overlay
-
setScoreBoardOverlayActive
public void setScoreBoardOverlayActive(boolean scoreBoardOverlayActive) Sets the score board overlay active state.- Parameters:
scoreBoardOverlayActive- the new state of the score board overlay
-
isUserSelectionOverlayActive
public boolean isUserSelectionOverlayActive()Checks if the user selection overlay is active.- Returns:
- true if the user selection overlay is active, false otherwise
-
isUserCreationOverlayActive
public boolean isUserCreationOverlayActive()Checks if the user creation overlay is active.- Returns:
- true if the user creation overlay is active, false otherwise
-
isScoreBoardOverlayActive
public boolean isScoreBoardOverlayActive()Checks if the score board overlay is active.- Returns:
- true if the score board overlay is active, false otherwise
-
getSelectionIndex
public int getSelectionIndex()Returns the current selection index.- Returns:
- the current selection index
-
setSelectionIndex
public void setSelectionIndex(int selectionIndex) Sets the selection index.- Parameters:
selectionIndex- the new selection index
-
increaseSelectionIndex
public void increaseSelectionIndex()Increases the selection index by one. -
decreaseSelectionIndex
public void decreaseSelectionIndex()Decreases the selection index by one. -
getMenuUserCreationOverlayModel
Returns the MenuUserCreationOverlayModel instance.- Returns:
- the MenuUserCreationOverlayModel instance
-
getMenuUserSelectionOverlayModel
Returns the MenuUserSelectionOverlayModel instance.- Returns:
- the MenuUserSelectionOverlayModel instance
-
getMenuScoreBoardOverlayModel
Returns the MenuScoreBoardOverlayModel instance.- Returns:
- the MenuScoreBoardOverlayModel instance
-