Merge branch 'master' into graphics-next
This commit is contained in:
@@ -443,25 +443,31 @@ namespace Ndk
|
||||
m_dirtyEntities = std::move(world.m_dirtyEntities);
|
||||
m_entityBlocks = std::move(world.m_entityBlocks);
|
||||
m_freeEntityIds = std::move(world.m_freeEntityIds);
|
||||
m_isProfilerEnabled = world.m_isProfilerEnabled;
|
||||
m_killedEntities = std::move(world.m_killedEntities);
|
||||
m_orderedSystems = std::move(world.m_orderedSystems);
|
||||
m_orderedSystemsUpdated = world.m_orderedSystemsUpdated;
|
||||
m_profilerData = std::move(world.m_profilerData);
|
||||
m_isProfilerEnabled = world.m_isProfilerEnabled;
|
||||
m_referencedByLists = std::move(world.m_referencedByLists);
|
||||
|
||||
m_entities = std::move(world.m_entities);
|
||||
for (EntityBlock& block : m_entities)
|
||||
block.entity.SetWorld(this);
|
||||
|
||||
for (EntityList* list : m_referencedByLists)
|
||||
list->SetWorld(this);
|
||||
|
||||
m_waitingEntities = std::move(world.m_waitingEntities);
|
||||
for (auto& blockPtr : m_waitingEntities)
|
||||
blockPtr->entity.SetWorld(this);
|
||||
|
||||
m_systems = std::move(world.m_systems);
|
||||
for (const auto& systemPtr : m_systems)
|
||||
{
|
||||
if (systemPtr)
|
||||
systemPtr->SetWorld(this);
|
||||
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -480,4 +486,19 @@ namespace Ndk
|
||||
{
|
||||
m_orderedSystemsUpdated = false;
|
||||
}
|
||||
|
||||
inline void World::RegisterEntityList(EntityList* list)
|
||||
{
|
||||
m_referencedByLists.push_back(list);
|
||||
}
|
||||
|
||||
inline void World::UnregisterEntityList(EntityList* list)
|
||||
{
|
||||
auto it = std::find(m_referencedByLists.begin(), m_referencedByLists.end(), list);
|
||||
assert(it != m_referencedByLists.end());
|
||||
|
||||
// Swap and pop idiom
|
||||
*it = m_referencedByLists.back();
|
||||
m_referencedByLists.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user