44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <Engine/Entity/Renderable.h>
|
|
#include <Engine/Entity/Hud.h>
|
|
#include <Engine/Level/Fixed.h>
|
|
|
|
namespace Engine {
|
|
class Scene;
|
|
}
|
|
|
|
class Engine::Scene {
|
|
protected:
|
|
std::string name;
|
|
Hud* HeadsUpDisplay = nullptr;
|
|
std::vector<Fixed*> FixedList{};
|
|
std::vector<Entity*> EntityList{};
|
|
public:
|
|
[[nodiscard]] bool EntityListContains(const Entity* entity) const;
|
|
[[nodiscard]] bool FixedListContains(const Fixed* fixed) const;
|
|
[[nodiscard]] size_t FixedCount() const;
|
|
[[nodiscard]] size_t EntityCount() const;
|
|
[[nodiscard]] std::string GetName() const;
|
|
public:
|
|
void AppendEntity(Entity* entity);
|
|
void AppendFixed(Fixed* fixed);
|
|
|
|
// Removes and deallocates.
|
|
void DestroyEntity(Entity* entity);
|
|
void DestroyFixed(Fixed* fixed);
|
|
|
|
// Only removes from the list.
|
|
void RemoveEntity(Entity* entity);
|
|
void RemoveFixed(Fixed* fixed);
|
|
|
|
virtual void Unload();
|
|
virtual void Init() {}
|
|
virtual void Update();
|
|
virtual void Render();
|
|
public:
|
|
explicit Scene(const std::string& name) : name(name) {}
|
|
virtual ~Scene();
|
|
};
|