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:
Thraix
2026-02-07 18:25:13 +01:00
parent e5866b2dcb
commit 9d5a5314a7
23 changed files with 729 additions and 245 deletions
+24 -3
View File
@@ -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);
}
}
}