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
Scene.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_SCENE_SCENE_HPP_
9#define GALAXY_SCENE_SCENE_HPP_
10
11#include <ankerl/unordered_dense.h>
12
17
18namespace galaxy
19{
20 namespace scene
21 {
28 class Scene final : public fs::Serializable
29 {
30 public:
36 Scene(const std::string& name);
37
41 virtual ~Scene();
42
50 void add_system(const std::string& system);
51
55 void load();
56
60 void unload();
61
67 void update(core::Registry& registry);
68
72 // void update_ui();
73
77 void render();
78
82 [[nodiscard]]
83 const std::string& name() const noexcept;
84
90 [[nodiscard]]
91 nlohmann::json serialize() override;
92
98 void deserialize(const nlohmann::json& json) override;
99
100 private:
104 Scene() = delete;
105
106 private:
110 std::string m_name;
111
116
117 /*///
120 graphics::Camera m_camera;
121
125 entt::dispatcher m_dispatcher;
126
130 b2World m_b2world;
131
135 map::World m_world;
136
140 int m_velocity_iterations;
141
145 int m_position_iterations;*/
146 };
147 } // namespace scene
148} // namespace galaxy
149
150#endif
Wrapper around entt::registry to expand functionality.
Definition Registry.hpp:21
Allows a class to be serialized.
Represents a scene in a game. Like the menu, game, etc.
Definition Scene.hpp:29
void add_system(const std::string &system)
Add a system to operate on entities in this scene.
Definition Scene.cpp:40
void load()
When scene is loaded and made active.
Definition Scene.cpp:46
Scene()=delete
Constructor.
const std::string & name() const noexcept
Get scene name.
Definition Scene.cpp:103
virtual ~Scene()
Destructor.
Definition Scene.cpp:35
void render()
Update ui.
Definition Scene.cpp:78
meta::SystemStack m_systems
List of systems to run.
Definition Scene.hpp:115
std::string m_name
Scene name for debug purposes.
Definition Scene.hpp:110
nlohmann::json serialize() override
Serializes object.
Definition Scene.cpp:119
void update(core::Registry &registry)
Process events and updates.
Definition Scene.cpp:55
void deserialize(const nlohmann::json &json) override
Deserializes from object.
Definition Scene.cpp:151
void unload()
When scene is deactivated / unloaded.
Definition Scene.cpp:50
std::vector< std::unique_ptr< systems::System > > SystemStack
Timer.hpp galaxy.
Definition Async.hpp:17