Added basics of the ECS world's life cycle

This commit is contained in:
2026-01-30 15:58:53 +02:00
parent cd59ed656a
commit 3fc4f3ec84
2 changed files with 29 additions and 1 deletions

View File

@@ -15,6 +15,26 @@
using namespace Tourmaline::Systems;
using namespace ECS;
void World::Step() {
preSystems();
// Actual systems will happen here
postSystems();
}
void World::preSystems() {
// Defined for future use
}
void World::postSystems() {
// Can't do a foreach with a std::stack
while (!entitiesToDisable.empty()) {
std::pair<Components::Enabled *, bool> &request = entitiesToDisable.top();
request.first->enabled = request.second;
entitiesToDisable.pop();
}
}
// Entities
Entity World::CreateEntity() {
auto newEntity = Random::GenerateUUID();