Pacman Torben Petré
Loading...
Searching...
No Matches
State Class Referenceabstract

#include <StateManager.h>

Inheritance diagram for State:
Collaboration diagram for State:

Public Member Functions

virtual void handleInput (const sf::Event::KeyEvent &keyPressed)=0
 Handler for KeyPressed events.
virtual void resized ()=0
 Called when the window is resized.
virtual void update (double dt)=0
virtual void render ()=0
 Render function that is called in the main Game loop.
virtual ~State ()=default

Protected Member Functions

 State (StateManager &ctx)
 Creates the base State object.

Protected Attributes

StateManagercontext

Constructor & Destructor Documentation

◆ ~State()

virtual State::~State ( )
virtualdefault

◆ State()

State::State ( StateManager & ctx)
explicitprotected

Creates the base State object.

State is a Base class and not supposed to be used separately.

Parameters
ctxStateManager

Member Function Documentation

◆ handleInput()

virtual void State::handleInput ( const sf::Event::KeyEvent & keyPressed)
pure virtual

Handler for KeyPressed events.

Parameters
keyPressedSFML KeyEvent

Implemented in GameOverState, LevelState, MenuState, PausedState, and VictoryState.

◆ render()

virtual void State::render ( )
pure virtual

Render function that is called in the main Game loop.

Should render everything relevant to the current state, that could be UI components, game elements or specific Views.

Implemented in GameOverState, LevelState, MenuState, PausedState, and VictoryState.

◆ resized()

virtual void State::resized ( )
pure virtual

Called when the window is resized.

Implemented in GameOverState, LevelState, MenuState, PausedState, and VictoryState.

◆ update()

virtual void State::update ( double dt)
pure virtual

@bief Update function that is called in the main Game loop.

Parameters
dtDeltatime

Implemented in GameOverState, LevelState, MenuState, PausedState, and VictoryState.

Member Data Documentation

◆ context

StateManager& State::context
protected

The documentation for this class was generated from the following files: