MCPcopy Create free account
hub / github.com/Illation/ETEngine / AddComponentList

Method AddComponentList

Engine/source/EtFramework/ECS/EcsCommandBuffer.cpp:118–132  ·  view source on GitHub ↗

------------------------------------ EcsCommandBuffer::AddComponentList

Source from the content-addressed store, hash-verified

116// EcsCommandBuffer::AddComponentList
117//
118void EcsCommandBuffer::AddComponentList(T_EntityId const entity, std::vector<RawComponentPtr> const& components)
119{
120 // get the component pointer buffer for the entity
121 auto buffer = m_AddComponents.emplace(entity, AddBuffer()).first;
122
123 // add components to buffer
124 for (RawComponentPtr const& comp : components)
125 {
126 // copy construct the component pointer
127 RawComponentPtr copy(comp.typeIdx, malloc(ComponentRegistry::Instance().GetSize(comp.typeIdx)));
128 ComponentRegistry::Instance().GetCopyAssign(comp.typeIdx)(comp.data, copy.data);
129
130 buffer->second.components.push_back(copy);
131 }
132}
133
134//----------------------------------------
135// EcsCommandBuffer::RemoveComponentTypes

Callers

nothing calls this directly

Calls 4

AddBufferClass · 0.85
emplaceMethod · 0.80
GetCopyAssignMethod · 0.80
GetSizeMethod · 0.45

Tested by

no test coverage detected