Better scene management.

This commit is contained in:
2025-01-02 12:57:21 -05:00
parent b9afc57e6e
commit 30bdd66086
13 changed files with 78 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
#include "Engine/Level/Scene.h"
#include <Engine/Level/Scene.h>
bool Scene::EntityListContains(const Entity* entity) const {
for (auto* e : EntityList)
@@ -47,6 +47,18 @@ Scene::~Scene() {
for (auto* e : EntityList)
delete e;
delete HeadsUpDisplay;
}
void Scene::Unload() {
for (auto* f : FixedList)
delete f;
for (auto* e : EntityList)
delete e;
delete HeadsUpDisplay;
}
void Scene::AppendEntity(Entity* entity) {
@@ -84,3 +96,7 @@ void Scene::RemoveFixed(Fixed* fixed) {
FixedList.erase(it);
}
std::string Scene::GetName() const {
return name;
}