MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetFirstMatchingComponent

Method GetFirstMatchingComponent

BG3Extender/GameDefinitions/EntitySystem.cpp:66–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64};
65
66void* QueryDescription::GetFirstMatchingComponent(std::size_t componentSize, bool isProxy)
67{
68 for (auto const& cls : EntityStorages.values()) {
69 if (cls.Storage->InstanceToPageMap.size() > 0) {
70 auto const& instPage = cls.Storage->InstanceToPageMap.values()[0];
71 auto componentIdx = cls.GetComponentIndex(0);
72 se_assert(cls.Storage->Components.size() >= 1);
73 return cls.Storage->GetComponent(instPage, componentIdx, componentSize, isProxy);
74 }
75 }
76
77 return {};
78}
79
80void PrintRange(EntitySystemHelpersBase& eh, char const* name, std::span<ComponentTypeIndex const> inds)
81{

Callers

nothing calls this directly

Calls 4

valuesMethod · 0.80
sizeMethod · 0.45
GetComponentIndexMethod · 0.45
GetComponentMethod · 0.45

Tested by

no test coverage detected