galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::SceneManager Class Referencefinal

State machine for managing scenes. More...

#include <SceneManager.hpp>

+ Inheritance diagram for galaxy::SceneManager:
+ Collaboration diagram for galaxy::SceneManager:

Public Member Functions

 SceneManager () noexcept
 Constructor.
 
 SceneManager (SceneManager &&)
 Move constructor.
 
SceneManageroperator= (SceneManager &&)
 Move assignment operator.
 
virtual ~SceneManager ()
 Destructor.
 
void on_event (SDL_Event &event)
 Handle an event for a scene.
 
void update ()
 Process events and updates.
 
void render ()
 Render scenes.
 
void clear ()
 Removes all data.
 
- Public Member Functions inherited from galaxy::StateMachine< Scene >
 StateMachine () noexcept
 Constructor.
 
 StateMachine (StateMachine< Stored > &&)
 Move constructor.
 
StateMachine< Stored > & operator= (StateMachine< Stored > &&)
 Move assignment operator.
 
virtual ~StateMachine ()
 Destructor.
 
std::shared_ptr< Stored > add (const std::string &key, Args &&... args)
 Add a new state.
 
std::shared_ptr< Stored > get (const std::string &key) noexcept
 Get a specific state.
 
bool has (const std::string &key) noexcept
 Does a state exist.
 
void remove (const std::string &key)
 Remove a specific state.
 
void push (const std::string &key) noexcept
 Push a state onto the top of stack.
 
void pop () noexcept
 Remove state on top of stack.
 
void pop_all () noexcept
 Remove all states in stack.
 
std::shared_ptr< Stored > top () const noexcept
 Get top state in stack.
 
Stackstack () noexcept
 Get stack.
 
Mapstorage () noexcept
 Get storage.
 

Private Member Functions

 SceneManager (const SceneManager &)=delete
 Copy constructor.
 
SceneManageroperator= (const SceneManager &)=delete
 Copy assignment operator.
 

Private Attributes

EntityManager m_entity_manager
 Entities belonging to all scenes.
 

Additional Inherited Members

- Protected Attributes inherited from galaxy::StateMachine< Scene >
Stack m_stack
 State stack.
 
Map m_storage
 State cache.
 

Detailed Description

State machine for managing scenes.

Definition at line 21 of file SceneManager.hpp.

Constructor & Destructor Documentation

◆ SceneManager() [1/3]

galaxy::SceneManager::SceneManager ( )
noexcept

Constructor.

Definition at line 12 of file SceneManager.cpp.

◆ SceneManager() [2/3]

galaxy::SceneManager::SceneManager ( SceneManager && w)

Move constructor.

Definition at line 17 of file SceneManager.cpp.

◆ ~SceneManager()

galaxy::SceneManager::~SceneManager ( )
virtual

Destructor.

Definition at line 32 of file SceneManager.cpp.

+ Here is the call graph for this function:

◆ SceneManager() [3/3]

galaxy::SceneManager::SceneManager ( const SceneManager & )
privatedelete

Copy constructor.

Member Function Documentation

◆ operator=() [1/2]

SceneManager & galaxy::SceneManager::operator= ( SceneManager && w)

Move assignment operator.

Definition at line 22 of file SceneManager.cpp.

+ Here is the call graph for this function:

◆ on_event()

void galaxy::SceneManager::on_event ( SDL_Event & event)

Handle an event for a scene.

Parameters
eEvent that was triggered.

Definition at line 37 of file SceneManager.cpp.

+ Here is the call graph for this function:

◆ update()

void galaxy::SceneManager::update ( )

Process events and updates.

Definition at line 45 of file SceneManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

void galaxy::SceneManager::render ( )

Render scenes.

Definition at line 53 of file SceneManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

void galaxy::SceneManager::clear ( )

Removes all data.

Definition at line 61 of file SceneManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [2/2]

SceneManager & galaxy::SceneManager::operator= ( const SceneManager & )
privatedelete

Copy assignment operator.

Member Data Documentation

◆ m_entity_manager

EntityManager galaxy::SceneManager::m_entity_manager
private

Entities belonging to all scenes.

Definition at line 81 of file SceneManager.hpp.


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