8#include <entt/locator/locator.hpp>
9#include <nlohmann/json.hpp>
42 auto&
sf = entt::locator<meta::SystemFactory>::value();
52 entt::locator<sol::state>::value().collect_garbage();
139 nlohmann::json json =
"{}"_json;
142 json[
"systems"] = nlohmann::json::object();
143 for (
auto i = 0; i <
m_systems.size(); i++)
145 json[
"systems"][std::to_string(i)] =
m_systems[i]->id();
155 const auto& systems = json.at(
"systems");
157 for (
const auto& [index,
name] : systems.items())
Wrapper around entt::registry to expand functionality.
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.
Scene()=delete
Constructor.
const std::string & name() const noexcept
Get scene name.
virtual ~Scene()
Destructor.
meta::SystemStack m_systems
List of systems to run.
std::string m_name
Scene name for debug purposes.
nlohmann::json serialize() override
Serializes object.
void update(core::Registry ®istry)
Process events and updates.
void deserialize(const nlohmann::json &json) override
Deserializes from object.
void unload()
When scene is deactivated / unloaded.