23 lines
662 B
C++
23 lines
662 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
#include <utils.hpp>
|
|
#include <object/entity.hpp>
|
|
|
|
namespace Game::State {
|
|
class GameState {
|
|
public:
|
|
static GameState& getInstance() { static GameState instance; return instance; }
|
|
|
|
// Retrieve a REFERENCE of the entities; DANGEROUS!
|
|
std::vector<std::unique_ptr<Object::Entity>>* getEntitiesRef();
|
|
// Update entity at index, by REFERENCE
|
|
Object::Entity* getAtIndex(size_t at);
|
|
|
|
void addEntity(std::unique_ptr<Object::Entity> entity);
|
|
|
|
private:
|
|
std::vector<std::unique_ptr<Object::Entity>> mEntities;
|
|
};
|
|
} |