8#ifndef GALAXY_SCENE_SCENEMANAGER_HPP_
9#define GALAXY_SCENE_SCENEMANAGER_HPP_
42 std::shared_ptr<Scene>
create(
const std::string& scene);
49 void set(
const std::string& scene);
56 void push(
const std::string& scene);
72 std::shared_ptr<Scene>
top()
noexcept;
91 void load_app(
const std::string& appdata_file);
98 void save_app(
const std::string& file);
111 bool empty()
const noexcept;
126 void deserialize(
const nlohmann::json& json)
override;
132 ankerl::unordered_dense::map<std::uint64_t, std::shared_ptr<Scene>>
m_scenes;
Wrapper around entt::registry to expand functionality.
Allows a class to be serialized.
Scene saving/loading, pushing, popping, creating. Also manages entities.
void save_app(const std::string &file)
Save all active scenes and sub data within those scenes.
bool empty() const noexcept
Are there any scenes.
std::shared_ptr< Scene > top() noexcept
Get top scene.
SceneManager() noexcept
Constructor.
void pop()
Remove scene on top of stack.
void set(const std::string &scene)
Clears all from stack and sets as active.
core::Registry m_registry
Entity data.
std::shared_ptr< Scene > create(const std::string &scene)
Create scene in engine.
void clear()
Deletes all scene data.
void deserialize(const nlohmann::json &json) override
Deserializes from object.
void update()
Process events and updates.
void render()
Render scenes.
ankerl::unordered_dense::map< std::uint64_t, std::shared_ptr< Scene > > m_scenes
Scene storage.
nlohmann::json serialize() override
Serializes object.
void pop_all()
Pop all scenes.
std::vector< std::shared_ptr< Scene > > m_stack
Active scenes.
void load_app(const std::string &appdata_file)
Load app data file into scene manager.
virtual ~SceneManager() noexcept
Destructor.
void push(const std::string &scene)
Push a scene onto the top of stack.