|
rigProject 0.1.1
RigKit pack API - rigProject
|
Templates that register one component codec on a document registry. More...
#include <functional>#include <string>#include "ecs/MEcs.h"#include "ComponentSerializerRegistry.h"Functions | |
| template<typename T> | |
| void | rigkit::project::addSerializer (ComponentSerializerRegistry ®istry, const char *key, const char *schemaId, std::function< bool(entt::registry &, entt::entity, ordered_json &)> serializeFn, std::function< bool(entt::registry &, entt::entity, const ordered_json &)> deserializeFn, std::function< void(entt::registry &, const EntityIdMap &)> remapReferences={}) |
| Register a typed component codec on a document registry. | |
| template<typename T> | |
| void | rigkit::project::registerComponent (MEcs &ecs, ComponentSerializerRegistry ®istry, const char *name, const char *schemaId, std::function< bool(entt::registry &, entt::entity, ordered_json &)> serializeFn, std::function< bool(entt::registry &, entt::entity, const ordered_json &)> deserializeFn, std::function< void(entt::registry &, const EntityIdMap &)> remapReferences={}) |
| Announce a portable component and file its document codec. | |
| template<typename T, bool T::* Member> | |
| void | rigkit::project::addBoolMemberSerializer (ComponentSerializerRegistry ®istry, const char *key, const char *schemaId, const char *fieldName) |
| Single bool field under a Contract / extension key (e.g. | |
| template<typename T> | |
| void | rigkit::project::addMarkerSerializer (ComponentSerializerRegistry ®istry, const char *key, const char *schemaId) |
| Empty marker component - wire value is {}. | |
Templates that register one component codec on a document registry.
They stay inline so rigProject never needs to see the component type.
| void rigkit::project::addBoolMemberSerializer | ( | ComponentSerializerRegistry & | registry, |
| const char * | key, | ||
| const char * | schemaId, | ||
| const char * | fieldName ) |
Single bool field under a Contract / extension key (e.g.
selectable.enabled).
| void rigkit::project::addSerializer | ( | ComponentSerializerRegistry & | registry, |
| const char * | key, | ||
| const char * | schemaId, | ||
| std::function< bool(entt::registry &, entt::entity, ordered_json &)> | serializeFn, | ||
| std::function< bool(entt::registry &, entt::entity, const ordered_json &)> | deserializeFn, | ||
| std::function< void(entt::registry &, const EntityIdMap &)> | remapReferences = {} ) |
Register a typed component codec on a document registry.
Packs that own portable PODs call this from setup() (via rigProject::registerSerializer / the registry). One schema id per call.
| void rigkit::project::registerComponent | ( | MEcs & | ecs, |
| ComponentSerializerRegistry & | registry, | ||
| const char * | name, | ||
| const char * | schemaId, | ||
| std::function< bool(entt::registry &, entt::entity, ordered_json &)> | serializeFn, | ||
| std::function< bool(entt::registry &, entt::entity, const ordered_json &)> | deserializeFn, | ||
| std::function< void(entt::registry &, const EntityIdMap &)> | remapReferences = {} ) |
Announce a portable component and file its document codec.
Owning data packs call this from setup() when rigProject is loaded. One schema id per call. A second schema on the same POD stays addSerializer.