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

Method BindComponent

BG3Extender/GameDefinitions/EntitySystem.cpp:943–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

941}
942
943void EntitySystemHelpersBase::BindComponent(StringView name, ComponentTypeIndex id)
944{
945 STDString const* pName;
946 auto it = componentNameToIndexMappings_.find(STDString(name));
947 if (it == componentNameToIndexMappings_.end()) {
948 auto iit = componentNameToIndexMappings_.insert(std::make_pair(name, IndexMappings{id, UndefinedReplicationComponent}));
949 pName = &iit.first->first;
950 } else {
951 it->second.ComponentIndex = id;
952 pName = &it->first;
953 }
954
955 auto& binding = ecsComponentData_.GetOrAdd(id);
956 binding.Name = pName;
957}
958
959void EntitySystemHelpersBase::BindReplication(StringView name, ReplicationTypeIndex id)
960{

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected