![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
Represents a scene in a game. Like the menu, game, etc. More...
#include <Scene.hpp>
Public Member Functions | |
Scene (const std::string &name) | |
Name constructor. | |
virtual | ~Scene () |
Destructor. | |
void | add_system (const std::string &system) |
Add a system to operate on entities in this scene. | |
void | load () |
When scene is loaded and made active. | |
void | unload () |
When scene is deactivated / unloaded. | |
void | update (core::Registry ®istry) |
Process events and updates. | |
void | render () |
Update ui. | |
const std::string & | name () const noexcept |
Get scene name. | |
nlohmann::json | serialize () override |
Serializes object. | |
void | deserialize (const nlohmann::json &json) override |
Deserializes from object. | |
![]() | |
virtual | ~Serializable () |
Destructor. | |
virtual Serializable & | operator= (Serializable &&)=default |
Move assignment operator. | |
virtual Serializable & | operator= (const Serializable &)=default |
Copy assignment operator. | |
Private Member Functions | |
Scene ()=delete | |
Constructor. | |
Private Attributes | |
std::string | m_name |
Scene name for debug purposes. | |
meta::SystemStack | m_systems |
List of systems to run. | |
Additional Inherited Members | |
![]() | |
Serializable () | |
Constructor. | |
Represents a scene in a game. Like the menu, game, etc.
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.
galaxy::scene::Scene::Scene | ( | const std::string & | name | ) |
|
privatedelete |
Constructor.
void galaxy::scene::Scene::add_system | ( | const std::string & | system | ) |
void galaxy::scene::Scene::load | ( | ) |
void galaxy::scene::Scene::unload | ( | ) |
void galaxy::scene::Scene::update | ( | core::Registry & | registry | ) |
void galaxy::scene::Scene::render | ( | ) |
|
nodiscardnoexcept |
|
nodiscardoverridevirtual |
Serializes object.
Implements galaxy::fs::Serializable.
|
overridevirtual |
Deserializes from object.
json | Json object to retrieve data from. |
Implements galaxy::fs::Serializable.
Definition at line 151 of file Scene.cpp.
|
private |
|
private |