mirror of
https://gitlab.com/voidframe/voidframe-cpp.git
synced 2026-06-28 19:35:12 -04:00
Add World::Update()
This commit is contained in:
@@ -11,6 +11,8 @@ public:
|
|||||||
Entity *Spawn();
|
Entity *Spawn();
|
||||||
void Destroy(Entity *entity);
|
void Destroy(Entity *entity);
|
||||||
|
|
||||||
|
void Update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<Entity>> entities;
|
std::vector<std::unique_ptr<Entity>> entities;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,3 +18,9 @@ void World::Destroy(Entity *entity) {
|
|||||||
return entityPtr.get() == entity;
|
return entityPtr.get() == entity;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void World::Update() {
|
||||||
|
for (auto &entity : entities) {
|
||||||
|
entity->Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user