Lums
|
This class represents a GameState. More...
#include <GameState.hpp>
Public Member Functions | |
LUMS_EXPORTED | GameState () |
virtual LUMS_EXPORTED void | load () |
virtual LUMS_EXPORTED void | unload () |
LUMS_EXPORTED void | reload () |
virtual void | update ()=0 |
virtual void | render ()=0 |
virtual void | handleEvent (const Event &event)=0 |
virtual bool | forwardUpdate () const |
virtual bool | forwardRender () const |
virtual bool | forwardEvent (const Event &event) const |
LUMS_EXPORTED void | remove () |
virtual LUMS_EXPORTED | ~GameState () |
This class represents a GameState.
A GameState defines one state of your Game. A state is a well-defined and encapsulated part of the game, such as the Title screen, the game itself, a menu... You should not use this class directly, instead, create your custom gamestate that inherit from this base class.
LUMS_EXPORTED lm::GameState::GameState | ( | ) |
GameState constructor. You should not instanciate gamestates yourself. Instead, use the factory methods Core::Push and Core::Transition.
|
virtual |
GameState dtor
|
inlinevirtual |
If this method return true, then HandleEvent() calls are forwarded to the next state. This method is called for each event. The default value is false.
event | The event to be forwarded. |
|
inlinevirtual |
If this method return true, then Render() calls are forwarded to the next state. The default value is false.
|
inlinevirtual |
If this method return true, then Update() calls are forwarded to the next state. The default value is false.
|
pure virtual |
Process Events. This method is called when a new event occurs. You must overwrite this method.
event | An event. |
|
virtual |
Called when the GameState is loaded. By default, do nothing.
LUMS_EXPORTED void lm::GameState::reload | ( | ) |
Reload the State. It's equivalent to a call to Unload, then a call to Load.
LUMS_EXPORTED void lm::GameState::remove | ( | ) |
|
pure virtual |
Render the state. This method is called when the state has to be redrawn. You must overwrite this method.
|
virtual |
Called when the GameState is unloaded. By default, do nothing.
|
pure virtual |
Update the state. This method is called on each physical tick. You must overwrite this method.