14 #ifndef GK_APPLICATIONSTATE_HPP_ 15 #define GK_APPLICATIONSTATE_HPP_ 24 class ApplicationStateStack;
64 virtual void onEvent(
const SDL_Event &) {}
111 #endif // GK_APPLICATIONSTATE_HPP_
ApplicationState * m_parent
Parent to this state.
ApplicationStateStack * m_stateStack
Stack where this state belongs to.
void setStateStack(ApplicationStateStack *stateStack)
Change the stack this state belongs to.
virtual void update()=0
Execute actions every game tick.
ApplicationState(ApplicationState *parent=nullptr)
Default constructor.
virtual void onEvent(const SDL_Event &)
Do an action in response to an SDL event.
ApplicationState * parent()
Get the parent of this state.
void draw(gk::RenderTarget &, gk::RenderStates) const override
Draw the sprite to a render target.
Stack containing ApplicationState instances.
Abstract base class for game states.
ApplicationState & operator=(ApplicationState &&)=default
Defaulted move assignment operator.
Abstract base class for objects that can be drawn to a render target.
virtual ~ApplicationState()=default
Virtual destructor.