Package rekit.logic
Interface Model
- All Known Implementing Classes:
GameModel
public interface Model
This Interface defines the Model for the MVC.
- Author:
- Dominik Fuchss
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThis enum defines the different states of the game. -
Method Summary
Modifier and TypeMethodDescriptionvoidend()End the model.booleanIndicates whether the filter has been changed.Get the current filter and resetfilterChanged().getMenu()Get the Menu.static ModelgetModel()Get the model.Get the Player.getScene()Get the current scene.getState()Get the current state.Get the special testscene's constructor.voidregisterTestScene(Function<GameModel, ILevelScene> constructor) Register a special testscene for debugging.voidRemove all filters.voidSet a filter.voidstart()Start the model.
-
Method Details
-
getModel
Get the model.- Returns:
- the model
-
getPlayer
Player getPlayer()Get the Player.- Returns:
- the player or
nullwhen not inModel.GameState.INGAME
-
getMenu
MenuItem getMenu()Get the Menu.- Returns:
- the menu or
nullwhen not inModel.GameState.MENU
-
start
void start()Start the model. -
end
void end()End the model. -
getScene
IScene getScene()Get the current scene. The scene to be drawn.- Returns:
- the currently active scene
-
getState
Model.GameState getState()Get the current state.- Returns:
- the state
-
setFilter
Set a filter.- Parameters:
f- the filter
-
removeFilter
void removeFilter()Remove all filters. -
getFilter
Filter getFilter()Get the current filter and resetfilterChanged().- Returns:
- the filter or
nullif none set
-
filterChanged
boolean filterChanged()Indicates whether the filter has been changed.- Returns:
trueif changed,falseotherwise
-
registerTestScene
Register a special testscene for debugging.- Parameters:
constructor- the constructor
-
getTestSceneConstructor
Function<GameModel,ILevelScene> getTestSceneConstructor()Get the special testscene's constructor.- Returns:
- the constructor if set
-