MCPcopy Create free account
hub / github.com/crownengine/crown / register_component_compiler

Function register_component_compiler

src/resource/unit_compiler.cpp:1236–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1234 }
1235
1236 void register_component_compiler(UnitCompiler &c, StringId32 type, CompileFunction fn, f32 spawn_order)
1237 {
1238 ComponentTypeData ctd(default_allocator());
1239 ctd._compiler = fn;
1240
1241 ComponentTypeInfo cti;
1242 cti._type = type;
1243 cti._spawn_order = spawn_order;
1244
1245 hash_map::set(c._component_data, type, ctd);
1246
1247 array::push_back(c._component_info, cti);
1248 std::sort(array::begin(c._component_info), array::end(c._component_info));
1249 }
1250
1251 void register_component_compiler(UnitCompiler &c, const char *type, CompileFunction fn, f32 spawn_order)
1252 {

Callers 1

UnitCompilerMethod · 0.85

Calls 5

setClass · 0.85
sortFunction · 0.50
beginFunction · 0.50
endFunction · 0.50
StringId32Class · 0.50

Tested by

no test coverage detected