Rework ECS framework
- Add queue systems when adding/removing components and systems - Add GlobalData to ECSManager, used to store data that is not specific to entities - Add View class, used to for loop all entities that contains the given Components - Rework how signaling works
This commit is contained in:
@@ -10,13 +10,34 @@ namespace Copium
|
||||
{
|
||||
}
|
||||
|
||||
void SystemOrderer::Before(const std::type_index& otherSystemId)
|
||||
void SystemOrderer::CommitOrdering()
|
||||
{
|
||||
for (const auto& [orderOperation, systemId] : orderQueue)
|
||||
{
|
||||
switch (orderOperation)
|
||||
{
|
||||
case OrderOperation::Before:
|
||||
{
|
||||
CommitBefore(systemId);
|
||||
break;
|
||||
}
|
||||
case OrderOperation::After:
|
||||
{
|
||||
CommitAfter(systemId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
orderQueue.clear();
|
||||
}
|
||||
|
||||
void SystemOrderer::CommitBefore(const std::type_index& otherSystemId)
|
||||
{
|
||||
systemPool->MoveSystemBefore(systemId, otherSystemId);
|
||||
}
|
||||
|
||||
void SystemOrderer::After(const std::type_index& otherSystemId)
|
||||
void SystemOrderer::CommitAfter(const std::type_index& otherSystemId)
|
||||
{
|
||||
systemPool->MoveSystemAfter(systemId, otherSystemId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user