6#include <nlohmann/json_fwd.hpp>
8#include "ecs/component/core/missing_assets.h"
10#include "ecs/entity_mapping.h"
11#include "io/scene/prefab.h"
13namespace Vkm::Engine {
62 const EntityNamer& name
78 const nlohmann::json& src,
82 const EntityResolver& resolve
154 const std::string& text,
Open type-erased resource registry with typed handles and generational lifetimes.
Definition resource_manager.h:46
Central registry managing entities and an open set of component types.
Definition scene.h:29
std::map< uint32_t, BuiltSlots > InstanceSlots
Every instance's BuiltSlots, keyed by the slot its root holds.
Definition prefab.h:100
Save / load a Scene + the assets it references to/from JSON.
Definition scene_serializer.h:28
bool loadFromString(const std::string &text, Scene &scene, ResourceManager &resources, const Prefab::InstanceSlots *instanceSlots=nullptr)
Load a scene from an in-memory JSON string produced by saveToString(), replacing scene and merging in...
void saveComponents(const Scene &scene, EntityId id, nlohmann::json &out, const ResourceManager &resources)
Write every serialized component of id into out, naming the entities they refer to by their scene slo...
bool load(Scene &scene, ResourceManager &resources, const std::string &path)
Load a scene from path, replacing the live scene atomically.
void loadComponents(const nlohmann::json &src, Scene &scene, EntityId entity, const ResourceManager &resources, const EntityResolver &resolve)
Add every component present in src to entity.
std::vector< MissingAssetRef > unresolvedRefs(const Scene &scene, const ResourceManager &resources, EntityId id)
The entries of id's unresolved-reference record whose field is still empty.
bool save(const Scene &scene, const ResourceManager &resources, const std::string &path)
Save scene + the assets it references to path.
std::string saveToString(const Scene &scene, const ResourceManager &resources)
Serialize scene + the assets it references to an in-memory JSON string (same content as save(),...
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23