rigProject 0.1.1
RigKit pack API - rigProject
Loading...
Searching...
No Matches
EntityIdRemap.h File Reference

Entity handles as document id strings, and reference fixup after a load. More...

#include <cstdint>
#include <entt/entt.hpp>
#include <string>
#include <unordered_map>
Include dependency graph for EntityIdRemap.h:

Functions

std::string rigkit::project::entityIdString (entt::entity entity)
 Document id for an entity, as the Contract's id string.
entt::entity rigkit::project::entityIdFromString (const std::string &id)
 Handle back out of an id written by entityIdString, or null.
void rigkit::project::remapEntityReferences (entt::registry &reg, const EntityIdMap &idMap)
 Rewrite entity references (e.g. CRelationship::parent) after load.

Detailed Description

Entity handles as document id strings, and reference fixup after a load.

Run the remap once every entity exists, so parent references resolve.

Function Documentation

◆ entityIdString()

std::string rigkit::project::entityIdString ( entt::entity entity)

Document id for an entity, as the Contract's id string.

Derived from the handle so a codec can name a parent without consulting the document. Names are not used: they may repeat or be empty, and an id has to be unique. The readable name travels in rig.meta.named.