10#include "ecs/component/core/transform.h"
11#include "ecs/component/prefab/prefab_instance.h"
13namespace Vkm::Engine {
83 bool definesComponent(
const std::string& path, uint32_t uid,
const std::string& component);
132 const std::string& path,
173 const std::string& path,
175 const std::vector<PrefabOverride>& overrides = {},
176 std::set<std::string>* drift =
nullptr,
200 const std::string& path,
203 const std::string& component,
204 const std::vector<PrefabOverride>& overrides
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
Entity subtrees saved once and instanced many times.
Definition prefab.h:32
bool save(Scene &scene, EntityId root, const std::string &path, const ResourceManager &resources)
Write root and its descendants to path as a prefab.
std::map< uint32_t, BuiltSlots > InstanceSlots
Every instance's BuiltSlots, keyed by the slot its root holds.
Definition prefab.h:100
EntityId instanceRootOf(const Scene &scene, EntityId id)
The root of the prefab instance id belongs to: itself, or its nearest ancestor carrying PrefabInstanc...
bool reloadComponent(Scene &scene, ResourceManager &resources, const std::string &path, EntityId entity, uint32_t uid, const std::string &component, const std::vector< PrefabOverride > &overrides)
Re-read one component of one instance entity from the prefab.
bool isInsideInstance(const Scene &scene, EntityId id)
Is id inside (but not the root of) a prefab instance?
bool instantiateInto(Scene &scene, ResourceManager &resources, const std::string &path, EntityId root, const std::vector< PrefabOverride > &overrides={}, std::set< std::string > *drift=nullptr, const BuiltSlots *slots=nullptr)
Build a prefab into an entity that already exists.
BuiltSlots builtSlotsOf(const Scene &scene, EntityId root)
Where the instance rooted at root put each of its entities.
std::map< uint32_t, uint32_t > BuiltSlots
Where one instance's built entities stand: prefab uid to slot.
Definition prefab.h:92
EntityId instantiate(Scene &scene, ResourceManager &resources, const std::string &path, const Transform &at)
Instantiate path into scene, placing the root at at.
bool definesComponent(const std::string &path, uint32_t uid, const std::string &component)
Does the prefab at path define component on the entity uid names?
InstanceSlots instanceSlotsOf(const Scene &scene)
builtSlotsOf for every instance in scene.
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23