Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
NDK class that represents a world. More...
Inherits Nz::HandledObject< T >.
Public Types | |
using | EntityVector = std::vector< EntityHandle > |
Public Member Functions | |
World (bool addDefaultSystems=true) | |
Constructs a World object. More... | |
World (const World &)=delete | |
World (World &&world) noexcept | |
Constructs a World object by move semantic. More... | |
~World () noexcept | |
Destructs the object and calls Clear. More... | |
void | AddDefaultSystems () |
Adds default systems to the world. | |
BaseSystem & | AddSystem (std::unique_ptr< BaseSystem > &&system) |
Adds a system to the world. More... | |
template<typename SystemType , typename... Args> | |
SystemType & | AddSystem (Args &&... args) |
Adds a system to the world. More... | |
const EntityHandle & | CreateEntity () |
Creates an entity in the world. More... | |
EntityVector | CreateEntities (unsigned int count) |
Creates multiple entities in the world. More... | |
void | Clear () noexcept |
Clears the world from every entities. More... | |
const EntityHandle & | CloneEntity (EntityId id) |
Clones the entity. More... | |
const EntityHandle & | GetEntity (EntityId id) |
Gets an entity. More... | |
const EntityList & | GetEntities () const |
Gets every entities in the world. More... | |
BaseSystem & | GetSystem (SystemIndex index) |
Gets a system in the world by index. More... | |
template<typename SystemType > | |
SystemType & | GetSystem () |
Gets a system in the world by type. More... | |
bool | HasSystem (SystemIndex index) const |
Checks whether or not a system is present in the world by index. More... | |
template<typename SystemType > | |
bool | HasSystem () const |
Checks whether or not a system is present in the world by type. More... | |
void | KillEntity (Entity *entity) |
Marks an entity for deletion. More... | |
void | KillEntities (const EntityVector &list) |
Kills a set of entities. More... | |
bool | IsEntityValid (const Entity *entity) const |
Checks whether or not an entity is valid. More... | |
bool | IsEntityIdValid (EntityId id) const |
Checks whether or not an entity is valid. More... | |
void | RemoveAllSystems () |
Removes each system from the world. | |
void | RemoveSystem (SystemIndex index) |
Removes a system from the world by index. More... | |
template<typename SystemType > | |
void | RemoveSystem () |
Removes a system from the world by type. | |
void | Update () |
Updates the world. More... | |
void | Update (float elapsedTime) |
Updates the world. More... | |
World & | operator= (const World &)=delete |
World & | operator= (World &&world) noexcept |
Moves a world into another world object. More... | |
NDK class that represents a world.
|
inline |
Constructs a World object.
addDefaultSystems | Should default provided systems be used |
|
inlinenoexcept |
|
noexcept |
Destructs the object and calls Clear.
|
inline |
Adds a system to the world.
system | System to add to the world |
SystemType & Ndk::World::AddSystem | ( | Args &&... | args | ) |
Adds a system to the world.
args | Arguments used to create the system |
|
noexcept |
Clears the world from every entities.
const EntityHandle & Ndk::World::CloneEntity | ( | EntityId | id | ) |
Clones the entity.
id | Identifier of the entity |
|
inline |
Creates multiple entities in the world.
count | Number of entities to create |
const EntityHandle & Ndk::World::CreateEntity | ( | ) |
Creates an entity in the world.
|
inline |
Gets every entities in the world.
|
inline |
Gets an entity.
id | Identifier of the entity |
|
inline |
Gets a system in the world by index.
index | Index of the system |
SystemType & Ndk::World::GetSystem | ( | ) |
Gets a system in the world by type.
|
inline |
Checks whether or not a system is present in the world by index.
index | Index of the system |
bool Ndk::World::HasSystem | ( | ) | const |
Checks whether or not a system is present in the world by type.
|
inline |
Checks whether or not an entity is valid.
id | Identifier of the entity |
|
inline |
Checks whether or not an entity is valid.
entity | Pointer to the entity |
|
inline |
Kills a set of entities.
This function has the same effect as calling KillEntity for every entity contained in the vector
list | Set of entities to kill |
|
inline |
Marks an entity for deletion.
Pointer | to the entity |
Moves a world into another world object.
|
inline |
Removes a system from the world by index.
index | Index of the system |
void Ndk::World::Update | ( | ) |
Updates the world.
|
inline |
Updates the world.
elapsedTime | Delta time used for the update |