Pacman Torben Petré
Loading...
Searching...
No Matches
GameContext Struct Reference

#include <StateManager.h>

Public Member Functions

 GameContext (const std::shared_ptr< logic::Score > &scoreSystem, const std::shared_ptr< SoundManager > &soundManager, const unsigned int lives)

Public Attributes

std::shared_ptr< logic::ScorescoreSystem
std::shared_ptr< SoundManagersoundManager
std::string username
unsigned int lives

Detailed Description

Struct used to hold constants throughout the states. This struct is owned by the StateManager and used by states to get access to its members. This way I can avoid recreating them, when one instance is enough. By giving ownership to the StateManager I can give it a simple getter, saving me from having to pass around a lot of arguments to different states.

Constructor & Destructor Documentation

◆ GameContext()

GameContext::GameContext ( const std::shared_ptr< logic::Score > & scoreSystem,
const std::shared_ptr< SoundManager > & soundManager,
const unsigned int lives )
inline

Member Data Documentation

◆ lives

unsigned int GameContext::lives

◆ scoreSystem

std::shared_ptr<logic::Score> GameContext::scoreSystem

◆ soundManager

std::shared_ptr<SoundManager> GameContext::soundManager

◆ username

std::string GameContext::username

The documentation for this struct was generated from the following file: