Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graphite/engine/core/include/world.hpp
2024-01-03 16:05:02 -05:00

40 lines
No EOL
709 B
C++

#pragma once
#include <json.hpp>
class GameInstance;
class Entity;
class Map;
/*
* Worlds are a collection of entities - but they only reference the entity's ids so they are technically still held by
* the entity pool.
*/
class World
{
friend class GameInstance;
public:
World(GameInstance* gameInstance) : m_gameInstance(gameInstance) {}
~World();
void LoadFromMap(Map* map);
void AddEntity(Entity* entity);
void AddEntity(int id);
nlohmann::json DumpToJSON();
std::string GetPath()
{
return m_path;
}
int skyboxID = 0;
protected:
std::vector<int> m_associatedEntities;
private:
std::string m_path;
GameInstance* m_gameInstance;
};