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
14#include "galaxy/fs/Serializable.hpp"
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
115 meta::SystemStack m_systems;
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
Represents a scene in a game. Like the menu, game, etc. Does not share resources.
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.
virtual ~Scene()
Destructor.
const std::string & name() const noexcept
Get scene name.
Definition Scene.cpp:103
void render()
Update ui.
meta::SystemStack m_systems
List of systems to run.
Definition Scene.hpp:115
virtual void update()
Process events and updates.
Definition Scene.cpp:61
std::string m_name
Scene name for debug purposes.
Definition Scene.hpp:94
nlohmann::json serialize() override
Serializes object.
Definition Scene.cpp:93
Scene(const std::string &name)
Name constructor.
void deserialize(const nlohmann::json &json) override
Deserializes from object.
Definition Scene.cpp:124
void unload()
When scene is deactivated / unloaded.
Animated.cpp galaxy.
Definition Animated.cpp:16
STL namespace.