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::Scene Class Referencefinal

Represents a scene in a game. More...

#include <Scene.hpp>

+ Inheritance diagram for galaxy::Scene:
+ Collaboration diagram for galaxy::Scene:

Public Member Functions

 Scene (const std::string &name) noexcept
 Name constructor.
 
virtual ~Scene ()
 Destructor.
 
void on_push () override
 When scene is pushed to the stack.
 
void on_pop () override
 When scene is popped from the stack.
 
void update (Registry &registry)
 Process events and updates.
 
void render ()
 Render scene.
 
void clear ()
 Remove all scene data.
 
void add_system (const std::string &system)
 Add a system to operate on entities in this scene.
 
- Public Member Functions inherited from galaxy::State
 State (State &&)=default
 Move constructor.
 
Stateoperator= (State &&)=default
 Move assignment operator.
 
 State (const State &)=default
 Copy constructor.
 
Stateoperator= (const State &)=default
 Copy assignment operator.
 
virtual ~State ()=default
 Virtual destructor.
 
const std::string & name () const noexcept
 Get state name.
 

Private Member Functions

 Scene ()=delete
 Constructor.
 
 Scene (const Scene &)=delete
 Copy constructor.
 
Sceneoperator= (const Scene &)=delete
 Copy assignment operator.
 

Private Attributes

SystemStack m_systems
 List of systems to process.
 

Additional Inherited Members

- Protected Member Functions inherited from galaxy::State
 State (const std::string &name) noexcept
 Name constructor.
 
- Protected Attributes inherited from galaxy::State
std::string m_name
 Name for debug purposes.
 

Detailed Description

Represents a scene in a game.

Scenes should be logically grouped -> i.e. a map, player data + ui, battle, menu, etc. Each scene is an independant collection of systems, but not entities.

Definition at line 22 of file Scene.hpp.

Constructor & Destructor Documentation

◆ Scene() [1/3]

galaxy::Scene::Scene ( const std::string & name)
noexcept

Name constructor.

Parameters
nameName of the scene for debug / editor purposes.

Definition at line 15 of file Scene.cpp.

◆ ~Scene()

galaxy::Scene::~Scene ( )
virtual

Destructor.

Definition at line 31 of file Scene.cpp.

+ Here is the call graph for this function:

◆ Scene() [2/3]

galaxy::Scene::Scene ( )
privatedelete

Constructor.

◆ Scene() [3/3]

galaxy::Scene::Scene ( const Scene & )
privatedelete

Copy constructor.

Member Function Documentation

◆ on_push()

void galaxy::Scene::on_push ( )
overridevirtual

When scene is pushed to the stack.

Implements galaxy::State.

Definition at line 36 of file Scene.cpp.

+ Here is the caller graph for this function:

◆ on_pop()

void galaxy::Scene::on_pop ( )
overridevirtual

When scene is popped from the stack.

Implements galaxy::State.

Definition at line 40 of file Scene.cpp.

+ Here is the caller graph for this function:

◆ update()

void galaxy::Scene::update ( Registry & registry)

Process events and updates.

Parameters
registryEntities to process.

Definition at line 48 of file Scene.cpp.

◆ render()

void galaxy::Scene::render ( )

Render scene.

Definition at line 59 of file Scene.cpp.

◆ clear()

void galaxy::Scene::clear ( )

Remove all scene data.

Definition at line 84 of file Scene.cpp.

+ Here is the caller graph for this function:

◆ add_system()

void galaxy::Scene::add_system ( const std::string & system)

Add a system to operate on entities in this scene.

Scene is called in order of adding. So i.e. if you add anim then render, systems are called in that order.

Parameters
systemName of system to add to this scene.

Definition at line 89 of file Scene.cpp.

+ Here is the caller graph for this function:

◆ operator=()

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

Copy assignment operator.

Member Data Documentation

◆ m_systems

SystemStack galaxy::Scene::m_systems
private

List of systems to process.

Definition at line 93 of file Scene.hpp.


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