4#include <unordered_map>
26 ~NetNames() =
default;
28 NetNames(
const NetNames& other) =
default;
29 NetNames& operator=(
const NetNames& other) =
default;
31 NetNames(NetNames && other) =
default;
32 NetNames& operator=(NetNames && other) =
default;
53 return entity &&
find(scene, entity.slot()) == entity;
94 std::unordered_map<uint32_t, EntityId> m_world;
95 std::unordered_map<uint32_t, EntityId> m_claimed;
96 std::vector<EntityId> m_ended;
void sweepEnded(Scene &scene)
Destroy what the session last ended had made, and their subtrees, if scene is still the world they we...
bool names(const Scene &scene, EntityId entity) const
Whether a slot of the server's names entity here: if not, it is this end's own.
Definition names.h:52
EntityId find(const Scene &scene, uint32_t slot) const
What the server's slot names here, if this end has it.
void endSession()
Forget what this session named; the world as loaded is kept for the next.
void adoptWorld(const Scene &scene)
The world as it was loaded, before anything ran: every live entity names its slot.
void clear()
Forget everything, the world as loaded too: it has been replaced.
void forget(Scene &scene, uint32_t slot)
The server says slot is gone: destroy what it named here, and its subtree.
EntityId claim(Scene &scene, uint32_t slot)
What the server's slot names here, made if this end has nothing for it yet.
Central registry managing entities and an open set of component types.
Definition scene.h:29
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23