68 void Save(
const std::string& filename)
const;
80 void Load(
const std::string& filename);
86 void Load(Json::Value& node);
93 std::vector<Entity*> entities;
97 std::vector<Entity*> updateEntities;
Entity containing various components.
Definition: Entity.hpp:16
std::string name
Name of the entity.
Definition: Entity.hpp:273
The game world containing all entities.
Definition: World.hpp:14
void RegisterUpdate(Entity *entity)
Register an entity to receive update events.
Definition: World.cpp:37
void ClearKilled()
Removes all killed entities and components in the world.
Definition: World.cpp:62
void CreateRoot()
Create root entity.
Definition: World.cpp:29
Entity * GetRoot() const
Get the root entity.
Definition: World.cpp:33
const std::vector< Entity * > & GetUpdateEntities() const
Get all entities that are registered to receive update events.
Definition: World.cpp:41
const std::vector< Entity * > & GetEntities() const
Get all the entities in the world.
Definition: World.cpp:25
void Load(const std::string &filename)
Load the world from file.
Definition: World.cpp:94
void Clear()
Clear the world of all entities.
Definition: World.cpp:45
~World()
Destructor.
Definition: World.cpp:14
Entity * CreateEntity(const std::string &name="")
Create a new entity in the world.
Definition: World.cpp:18
void Save(const std::string &filename) const
Save the world to file.
Definition: World.cpp:79
Json::Value GetSaveJson() const
Get a json file representing the root.
Definition: World.cpp:88
World()
Create a new world.
Definition: World.cpp:12