|
Hymn to Beauty
C++ 3D Engine
|
The game world containing all entities. More...
#include <World.hpp>
Public Member Functions | |
| World () | |
| Create a new world. More... | |
| ~World () | |
| Destructor. More... | |
| Entity * | CreateEntity (const std::string &name="") |
| Create a new entity in the world. More... | |
| const std::vector< Entity * > & | GetEntities () const |
| Get all the entities in the world. More... | |
| void | CreateRoot () |
| Create root entity. More... | |
| Entity * | GetRoot () const |
| Get the root entity. More... | |
| void | RegisterUpdate (Entity *entity) |
| Register an entity to receive update events. More... | |
| const std::vector< Entity * > & | GetUpdateEntities () const |
| Get all entities that are registered to receive update events. More... | |
| void | Clear () |
| Clear the world of all entities. More... | |
| void | ClearKilled () |
| Removes all killed entities and components in the world. More... | |
| void | Save (const std::string &filename) const |
| Save the world to file. More... | |
| Json::Value | GetSaveJson () const |
| Get a json file representing the root. More... | |
| void | Load (const std::string &filename) |
| Load the world from file. More... | |
| void | Load (Json::Value &node) |
| Load the world from a json. More... | |
Friends | |
| class | Entity |
The game world containing all entities.
| World::World | ( | ) |
Create a new world.
| World::~World | ( | ) |
Destructor.
| void World::Clear | ( | ) |
Clear the world of all entities.
| void World::ClearKilled | ( | ) |
Removes all killed entities and components in the world.
| Entity * World::CreateEntity | ( | const std::string & | name = "" | ) |
Create a new entity in the world.
| name | Name of the entity to create. |
| void World::CreateRoot | ( | ) |
Create root entity.
| const std::vector< Entity * > & World::GetEntities | ( | ) | const |
Get all the entities in the world.
| Entity * World::GetRoot | ( | ) | const |
Get the root entity.
| Json::Value World::GetSaveJson | ( | ) | const |
Get a json file representing the root.
| const std::vector< Entity * > & World::GetUpdateEntities | ( | ) | const |
Get all entities that are registered to receive update events.
| void World::Load | ( | const std::string & | filename | ) |
Load the world from file.
| filename | The name of the file. |
| void World::Load | ( | Json::Value & | node | ) |
Load the world from a json.
| node | The json containing a scene to load. |
| void World::RegisterUpdate | ( | Entity * | entity | ) |
Register an entity to receive update events.
| entity | Entity to register. |
| void World::Save | ( | const std::string & | filename | ) | const |
Save the world to file.
| filename | The name of the file. |
|
friend |