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 enum
This enum defines the different states of the game. -
Method Summary
Modifier and TypeMethodDescriptionvoid
end()
End the model.boolean
Indicates whether the filter has been changed.Get the current filter and resetfilterChanged()
.getMenu()
Get the Menu.static Model
getModel()
Get the model.Get the Player.getScene()
Get the current scene.getState()
Get the current state.Get the special testscene's constructor.void
registerTestScene
(Function<GameModel, ILevelScene> constructor) Register a special testscene for debugging.void
Remove all filters.void
Set a filter.void
start()
Start the model.
-
Method Details
-
getModel
Get the model.- Returns:
- the model
-
getPlayer
Player getPlayer()Get the Player.- Returns:
- the player or
null
when not inModel.GameState.INGAME
-
getMenu
MenuItem getMenu()Get the Menu.- Returns:
- the menu or
null
when 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
null
if none set
-
filterChanged
boolean filterChanged()Indicates whether the filter has been changed.- Returns:
true
if changed,false
otherwise
-
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
-