|
Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
|
This object keeps track of all available entities. NOTE: only the Engine class is allowed to create this object. More...
#include <EntitySystem.hpp>
Public Member Functions | |||
| void | RemoveAllEntities () | ||
| This method allows you to clear the entire entity system and all the teams. More... | |||
| eastl::weak_ptr< Entity > | CreateEntity (eastl::string entityName="", int teamId=0) | ||
| Allows you to create a new Entity. This method will also add the entity to the given team if that team id exists. If the given team id does not exist, or it's kept on 0, it'll add the entity to the last created team. If there are no excisting teams, it'll create a new team and add the entity to it. Use teamId -1 to not add a an entity to a team at all. NOTE: Using a teamId lower than -1 will revert the teamId to -1. More... | |||
| template<typename EntityType > | |||
| eastl::weak_ptr< EntityType > | CreateEntity (eastl::string entityName="") | ||
| Allows you to create a new Entity. This method will also add the entity to the given team if that team id exists. If the given team id does not exist, or it's kept on 0, it'll add the entity to the last created team. If there are no excisting teams, it'll create a new team and add the entity to it. Use teamId -1 to not add a an entity to a team at all. NOTE: Using a teamId lower than -1 will revert the teamId to -1. More... | |||
| template<class EntityType , class... Args> | |||
| eastl::weak_ptr< EntityType > | CreateEntity (eastl::string entityName="", Args &&...args) | ||
| Allows you to create a new Entity. This method will also add the entity to the given team if that team id exists. If the given team id does not exist, or it's kept on 0, it'll add the entity to the last created team. If there are no excisting teams, it'll create a new team and add the entity to it. Use teamId -1 to not add a an entity to a team at all. NOTE: Using a teamId lower than -1 will revert the teamId to -1. More... | |||
| eastl::weak_ptr< Entity > | GetEntity (uint64_t Id) | ||
| Allows you to get the entity you want based on the id number. NOTE: if you know the team id of the entity, it's often faster to call the method with the team id defined. More... | |||
| eastl::vector< eastl::shared_ptr< Entity > > | GetAllEntities () const | ||
| This method will allow you to get all entities availible. More... | |||
| template<typename ComponentType > | |||
| eastl::vector< eastl::weak_ptr< ComponentType > > | GetAllComponents () | ||
| This method allows you to get a vector of weak pointers with the component type you are looking for. More... | |||
| template<typename ComponentType > | |||
| eastl::vector< eastl::weak_ptr< Entity > > | GetAllEntitiesWithComponent () | ||
| This method allows you to get a vector of weak pointer with entities that have the defined component attached to them. More... | |||
| void | AddEntity (eastl::shared_ptr< Entity > entityToAdd) | ||
This method allows you to add a precreated entity to the entity system
| |||
| void | RemoveEntity (eastl::shared_ptr< Entity > entityToRemove) | ||
This method allows you to remove a specific entity from the entity system
| |||
| ~EntitySystem () | |||
Friends | |
| class | Engine |
This object keeps track of all available entities. NOTE: only the Engine class is allowed to create this object.
Definition at line 13 of file EntitySystem.hpp.
| Engine::EntitySystem::~EntitySystem | ( | ) |
Definition at line 8 of file EntitySystem.cpp.
| void Engine::EntitySystem::AddEntity | ( | eastl::shared_ptr< Entity > | entityToAdd | ) |
This method allows you to add a precreated entity to the entity system
| entityToAdd | The entity you want to add to the entity system. |
Definition at line 47 of file EntitySystem.cpp.
| eastl::weak_ptr< Entity > Engine::EntitySystem::CreateEntity | ( | eastl::string | entityName = "", |
| int | teamId = 0 |
||
| ) |
Allows you to create a new Entity. This method will also add the entity to the given team if that team id exists. If the given team id does not exist, or it's kept on 0, it'll add the entity to the last created team. If there are no excisting teams, it'll create a new team and add the entity to it. Use teamId -1 to not add a an entity to a team at all. NOTE: Using a teamId lower than -1 will revert the teamId to -1.
| entityName | The name of the entity you want to create, this is empty by default. |
| teamId | The team id you want to add the entity to. Default is 0 |
Definition at line 19 of file EntitySystem.cpp.
| eastl::weak_ptr< EntityType > Engine::EntitySystem::CreateEntity | ( | eastl::string | entityName = "" | ) |
Allows you to create a new Entity. This method will also add the entity to the given team if that team id exists. If the given team id does not exist, or it's kept on 0, it'll add the entity to the last created team. If there are no excisting teams, it'll create a new team and add the entity to it. Use teamId -1 to not add a an entity to a team at all. NOTE: Using a teamId lower than -1 will revert the teamId to -1.
| entityName | The name of the entity you want to create, this is empty by default. |
Definition at line 112 of file EntitySystem.hpp.
| eastl::weak_ptr< EntityType > Engine::EntitySystem::CreateEntity | ( | eastl::string | entityName = "", |
| Args &&... | args | ||
| ) |
Allows you to create a new Entity. This method will also add the entity to the given team if that team id exists. If the given team id does not exist, or it's kept on 0, it'll add the entity to the last created team. If there are no excisting teams, it'll create a new team and add the entity to it. Use teamId -1 to not add a an entity to a team at all. NOTE: Using a teamId lower than -1 will revert the teamId to -1.
| entityName | The name of the entity you want to create, this is empty by default. |
| ...args | Any given argument you require for your entity. |
Definition at line 122 of file EntitySystem.hpp.
| eastl::vector< eastl::weak_ptr< ComponentType > > Engine::EntitySystem::GetAllComponents | ( | ) |
This method allows you to get a vector of weak pointers with the component type you are looking for.
Definition at line 133 of file EntitySystem.hpp.
| eastl::vector< eastl::shared_ptr< Entity > > Engine::EntitySystem::GetAllEntities | ( | ) | const |
This method will allow you to get all entities availible.
Definition at line 71 of file EntitySystem.cpp.
| eastl::vector< eastl::weak_ptr< Entity > > Engine::EntitySystem::GetAllEntitiesWithComponent | ( | ) |
This method allows you to get a vector of weak pointer with entities that have the defined component attached to them.
Definition at line 149 of file EntitySystem.hpp.
| eastl::weak_ptr< Entity > Engine::EntitySystem::GetEntity | ( | uint64_t | Id | ) |
Allows you to get the entity you want based on the id number. NOTE: if you know the team id of the entity, it's often faster to call the method with the team id defined.
| Id | The entity you want to get. |
Definition at line 27 of file EntitySystem.cpp.
| void Engine::EntitySystem::RemoveAllEntities | ( | ) |
This method allows you to clear the entire entity system and all the teams.
Definition at line 13 of file EntitySystem.cpp.
| void Engine::EntitySystem::RemoveEntity | ( | eastl::shared_ptr< Entity > | entityToRemove | ) |
This method allows you to remove a specific entity from the entity system
| entityToRemove | The entity you want to remove from the entity system. |
Definition at line 56 of file EntitySystem.cpp.
|
friend |
Definition at line 101 of file EntitySystem.hpp.
1.8.11