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>

+ Collaboration diagram for galaxy::Scene:

Public Member Functions

 Scene (const std::string &name) noexcept
 Name constructor.
 
 ~Scene ()
 Destructor.
 
void load ()
 When scene is pushed to the stack.
 
void unload ()
 When scene is popped from the stack.
 
void update (Registry &registry)
 Process events and updates.
 
void render ()
 Render scene.
 
void add_system (const std::string &system)
 Add a system to operate on entities in this scene.
 
void clear ()
 Remove all scene data.
 
const std::string & name () const noexcept
 Get scene name.
 

Private Member Functions

 Scene ()=delete
 Constructor.
 

Private Attributes

std::string m_name
 Scene name for debug purposes.
 
std::vector< Systemm_systems
 List of systems to process.
 

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 21 of file Scene.hpp.

Constructor & Destructor Documentation

◆ Scene() [1/2]

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 ( )

Destructor.

Definition at line 30 of file Scene.cpp.

+ Here is the call graph for this function:

◆ Scene() [2/2]

galaxy::Scene::Scene ( )
privatedelete

Constructor.

Member Function Documentation

◆ load()

void galaxy::Scene::load ( )

When scene is pushed to the stack.

Definition at line 35 of file Scene.cpp.

◆ unload()

void galaxy::Scene::unload ( )

When scene is popped from the stack.

Definition at line 39 of file Scene.cpp.

◆ update()

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

Process events and updates.

Parameters
registryEntities to process.

Definition at line 44 of file Scene.cpp.

◆ render()

void galaxy::Scene::render ( )

Render scene.

Definition at line 55 of file Scene.cpp.

◆ 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 80 of file Scene.cpp.

◆ clear()

void galaxy::Scene::clear ( )

Remove all scene data.

Definition at line 86 of file Scene.cpp.

+ Here is the caller graph for this function:

◆ name()

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

Get scene name.

Returns
Const string.

Definition at line 91 of file Scene.cpp.

Member Data Documentation

◆ m_name

std::string galaxy::Scene::m_name
private

Scene name for debug purposes.

Definition at line 90 of file Scene.hpp.

◆ m_systems

std::vector<System> galaxy::Scene::m_systems
private

List of systems to process.

Definition at line 95 of file Scene.hpp.


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