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

Scene saving/loading, pushing, popping, creating, Entity management. More...

#include <World.hpp>

+ Collaboration diagram for galaxy::World:

Public Member Functions

 World () noexcept
 Constructor.
 
 ~World () noexcept
 Destructor.
 
std::shared_ptr< Sceneadd (const std::string &name)
 Add a new scene.
 
std::shared_ptr< Sceneget (const std::string &name) noexcept
 Get a specific scene.
 
void remove (const std::string &name)
 Remove a specific scene.
 
bool has (const std::string &name) noexcept
 Does a scene exist.
 
void push (const std::string &name) noexcept
 Push a scene onto the top of stack.
 
void pop () noexcept
 Remove scene on top of stack.
 
void pop_all () noexcept
 Remove all scenes in stack.
 
std::shared_ptr< Scenetop () const noexcept
 Get top scene in stack.
 
void update ()
 Process events and updates.
 
void render ()
 Render scenes.
 
void clear ()
 Removes all data.
 
SceneMapget_scenes () noexcept
 Get Scene storage.
 
SceneStackget_scene_stack () noexcept
 Get Scene stack.
 

Private Types

using SceneMap = ankerl::unordered_dense::map<std::uint64_t, std::shared_ptr<Scene>>
 
using SceneStack = std::vector<std::shared_ptr<Scene>>
 

Private Attributes

Registry m_registry
 Entity data.
 
SceneMap m_scenes
 Scene storage.
 
SceneStack m_scene_stack
 Active scenes.
 

Detailed Description

Scene saving/loading, pushing, popping, creating, Entity management.

Definition at line 21 of file World.hpp.

Member Typedef Documentation

◆ SceneMap

using galaxy::World::SceneMap = ankerl::unordered_dense::map<std::uint64_t, std::shared_ptr<Scene>>
private

Definition at line 23 of file World.hpp.

◆ SceneStack

using galaxy::World::SceneStack = std::vector<std::shared_ptr<Scene>>
private

Definition at line 24 of file World.hpp.

Constructor & Destructor Documentation

◆ World()

galaxy::World::World ( )
noexcept

Constructor.

Definition at line 16 of file World.cpp.

◆ ~World()

galaxy::World::~World ( )
noexcept

Destructor.

Definition at line 20 of file World.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

std::shared_ptr< Scene > galaxy::World::add ( const std::string & name)

Add a new scene.

Parameters
nameScene name.
Returns
Shared pointer to added scene.

Definition at line 25 of file World.cpp.

+ Here is the call graph for this function:

◆ get()

std::shared_ptr< Scene > galaxy::World::get ( const std::string & name)
nodiscardnoexcept

Get a specific scene.

Parameters
nameName of scene.
Returns
Shared pointer to scene.

Definition at line 41 of file World.cpp.

+ Here is the call graph for this function:

◆ remove()

void galaxy::World::remove ( const std::string & name)

Remove a specific scene.

Parameters
nameName of scene.

Definition at line 56 of file World.cpp.

+ Here is the call graph for this function:

◆ has()

bool galaxy::World::has ( const std::string & name)
nodiscardnoexcept

Does a scene exist.

Parameters
nameName of scene.
Returns
True if exists.

Definition at line 62 of file World.cpp.

+ Here is the call graph for this function:

◆ push()

void galaxy::World::push ( const std::string & name)
noexcept

Push a scene onto the top of stack.

Parameters
nameName of scene.

Definition at line 68 of file World.cpp.

◆ pop()

void galaxy::World::pop ( )
noexcept

Remove scene on top of stack.

Definition at line 81 of file World.cpp.

+ Here is the caller graph for this function:

◆ pop_all()

void galaxy::World::pop_all ( )
noexcept

Remove all scenes in stack.

Definition at line 90 of file World.cpp.

+ Here is the call graph for this function:

◆ top()

std::shared_ptr< Scene > galaxy::World::top ( ) const
nodiscardnoexcept

Get top scene in stack.

Returns
Shared pointer to top scene.

Definition at line 98 of file World.cpp.

◆ update()

void galaxy::World::update ( )

Process events and updates.

Definition at line 108 of file World.cpp.

◆ render()

void galaxy::World::render ( )

Render scenes.

Definition at line 116 of file World.cpp.

◆ clear()

void galaxy::World::clear ( )

Removes all data.

Definition at line 124 of file World.cpp.

+ Here is the caller graph for this function:

◆ get_scenes()

World::SceneMap & galaxy::World::get_scenes ( )
nodiscardnoexcept

Get Scene storage.

Returns
Reference.

Definition at line 130 of file World.cpp.

◆ get_scene_stack()

World::SceneStack & galaxy::World::get_scene_stack ( )
nodiscardnoexcept

Get Scene stack.

Returns
Reference.

Definition at line 135 of file World.cpp.

Member Data Documentation

◆ m_registry

Registry galaxy::World::m_registry
private

Entity data.

Definition at line 134 of file World.hpp.

◆ m_scenes

SceneMap galaxy::World::m_scenes
private

Scene storage.

Definition at line 139 of file World.hpp.

◆ m_scene_stack

SceneStack galaxy::World::m_scene_stack
private

Active scenes.

Definition at line 144 of file World.hpp.


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