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

Method get_mask

modules/engine/runtime/src/ecs/archetype.cpp:564–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562}
563
564sugoi_mask_comp_t sugoi_group_t::get_mask(const sugoi_type_set_t& subtype) const noexcept
565{
566 using namespace sugoi;
567 std::bitset<32> mask;
568 SIndex i = 0, j = 0;
569 auto stype = type.type;
570 while (i < stype.length && j < subtype.length)
571 {
572 if (stype.data[i] > subtype.data[j])
573 ++j;
574 else if (stype.data[i] < subtype.data[j])
575 ++i;
576 else
577 {
578 mask.set(i);
579 ++i;
580 ++j;
581 }
582 }
583 return mask.to_ulong();
584}
585
586extern "C" {
587int sugoiG_has_components(const sugoi_group_t* group, const sugoi_type_set_t* types)

Callers 6

components_enabledMethod · 0.45
sugoiS_enable_componentsFunction · 0.45
queryMethod · 0.45
enable_componentsFunction · 0.45
disable_componentsFunction · 0.45

Calls 2

to_ulongMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected