MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / serialize_type

Method serialize_type

modules/engine/runtime/src/ecs/serialize.cpp:128–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void sugoi_storage_t::serialize_type(const sugoi_entity_type_t& type, skr_binary_writer_t* s, bool keepMeta)
129{
130 using namespace sugoi;
131 namespace bin = skr::binary;
132 // group is define by entity_type, so we just serialize it's type
133 // todo: assert(s.is_serialize());
134 bin::Archive(s, type.type.length);
135 auto& reg = type_registry_t::get();
136 for (SIndex i = 0; i < type.type.length; i++)
137 {
138 auto t = type.type.data[i];
139 bin::Archive(s, reg.descriptions[type_index_t(t).index()].guid);
140 }
141 if(keepMeta)
142 {
143 bin::Archive(s, type.meta.length);
144 ArchiveBuffer(s, type.meta.data, type.meta.length);
145 }
146}
147
148sugoi_entity_type_t sugoi_storage_t::deserialize_type(sugoi::fixed_stack_t& stack, skr_binary_reader_t* s, bool keepMeta)
149{

Callers

nothing calls this directly

Calls 5

ArchiveFunction · 0.85
type_index_tClass · 0.85
ArchiveBufferFunction · 0.85
getFunction · 0.50
indexMethod · 0.45

Tested by

no test coverage detected