Pacman Torben Petré
Loading...
Searching...
No Matches
LevelState Class Referencefinal

#include <LevelState.h>

Inheritance diagram for LevelState:
Collaboration diagram for LevelState:

Public Member Functions

 LevelState (passkey, StateManager &context)
 This State initiates a Pacman level by setting up a logic::World and rendering the game views.
void handleInput (const sf::Event::KeyEvent &keyPressed) override
 Passes concrete Moves to the World instance & handles pausing.
void resized () override
 Will resize the Game Views.
void update (double dt) override
 Updates ScoreSystem and World.
void render () override
 Renders all Views associated with this level. Does this on a layer basis.
Public Member Functions inherited from State
virtual ~State ()=default
Public Member Functions inherited from logic::Observer
virtual ~Observer ()=default

Static Public Member Functions

static std::shared_ptr< LevelStatecreate (StateManager &context)
 Creates a LevelState which initiates a Pacman Level by setting up a logic::Word and rendering the game views.

Additional Inherited Members

Protected Member Functions inherited from State
 State (StateManager &ctx)
 Creates the base State object.
Protected Attributes inherited from State
StateManagercontext

Constructor & Destructor Documentation

◆ LevelState()

LevelState::LevelState ( passkey ,
StateManager & context )
explicit

This State initiates a Pacman level by setting up a logic::World and rendering the game views.

Warning
This constructor uses the passkey pattern as you are not suposed to directly interact with it. Use LevelState::create instead.
Parameters
contextStateManager

Member Function Documentation

◆ create()

std::shared_ptr< LevelState > LevelState::create ( StateManager & context)
static

Creates a LevelState which initiates a Pacman Level by setting up a logic::Word and rendering the game views.

Parameters
context
Returns
LevelState std::shared_ptr

◆ handleInput()

void LevelState::handleInput ( const sf::Event::KeyEvent & keyPressed)
overridevirtual

Passes concrete Moves to the World instance & handles pausing.

Parameters
keyPressedSFML KeyEvent

Implements State.

◆ render()

void LevelState::render ( )
overridevirtual

Renders all Views associated with this level. Does this on a layer basis.

Implements State.

◆ resized()

void LevelState::resized ( )
overridevirtual

Will resize the Game Views.

Implements State.

◆ update()

void LevelState::update ( double dt)
overridevirtual

Updates ScoreSystem and World.

Parameters
dtDeltatime

Implements State.


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