|
2D Engine v0.1.0
|
Scene object to hold all entities and components. More...
#include <Scene.hpp>

Classes | |
| struct | EntityDesc |
| Entity Description. More... | |
Public Member Functions | |
| EntityID | NewEntity () |
| Construct a new Entity object. | |
| template<typename T > | |
| T * | Assign (EntityID id) |
| Assign a component to an entity. | |
| template<typename T > | |
| T * | Get (EntityID id) |
| Get the component object from an entity. | |
| template<typename T > | |
| void | Remove (EntityID id) |
| Remove a component from an entity. | |
| void | DestroyEntity (EntityID id) |
| Destroy an entity. | |
| void | CreateSpriteSheetTile (int x, int y, b2World *physicsWorld, Board *board) |
| Create a new SpriteSheet entity. | |
| void | AddBox2DCollider (EntityID entityID, bool isStatic, bool isTrigger, float x, float y, float width, float height, b2World *physicsWorld) |
| Add a Box2D collider to an entity. | |
| template<class T > | |
| int | GetId () |
| EntityID | CreateEntityId (EntityIndex index, EntityVersion version) |
| EntityIndex | GetEntityIndex (EntityID id) |
| EntityVersion | GetEntityVersion (EntityID id) |
| bool | IsEntityValid (EntityID id) |
Public Attributes | |
| std::vector< EntityDesc > | entities |
| std::vector< ComponentPool * > | componentPools |
| std::vector< EntityIndex > | freeEntities |
| bool | m_showGrid = true |
| bool | m_showColliders = true |
| EntityID | m_selectedEntity = -1 |
Scene object to hold all entities and components.
| void Scene::AddBox2DCollider | ( | EntityID | entityID, |
| bool | isStatic, | ||
| bool | isTrigger, | ||
| float | x, | ||
| float | y, | ||
| float | width, | ||
| float | height, | ||
| b2World * | physicsWorld ) |
Add a Box2D collider to an entity.
| entityID | |
| isStatic | |
| x | |
| y | |
| physicsWorld |
| template Box2DColliderComponent * Scene::Assign< Box2DColliderComponent > | ( | EntityID | id | ) |
Assign a component to an entity.
| T | Component |
| id | Entity ID |
| EntityID Scene::CreateEntityId | ( | EntityIndex | index, |
| EntityVersion | version ) |
| void Scene::CreateSpriteSheetTile | ( | int | x, |
| int | y, | ||
| b2World * | physicsWorld, | ||
| Board * | board ) |
Create a new SpriteSheet entity.
| x | |
| y | |
| sheetLocal | |
| physicsWorld |
| void Scene::DestroyEntity | ( | EntityID | id | ) |
Destroy an entity.
| id | Entity ID |
| template Box2DColliderComponent * Scene::Get< Box2DColliderComponent > | ( | EntityID | id | ) |
Get the component object from an entity.
| T | Component |
| id | Entity ID |
| EntityIndex Scene::GetEntityIndex | ( | EntityID | id | ) |
| EntityVersion Scene::GetEntityVersion | ( | EntityID | id | ) |
| int Scene::GetId | ( | ) |
| bool Scene::IsEntityValid | ( | EntityID | id | ) |
| EntityID Scene::NewEntity | ( | ) |
Construct a new Entity object.
| template void Scene::Remove< Box2DColliderComponent > | ( | EntityID | id | ) |
Remove a component from an entity.
| T | Component |
| id | Entity ID |
| std::vector<ComponentPool *> Scene::componentPools |
| std::vector<EntityDesc> Scene::entities |
| std::vector<EntityIndex> Scene::freeEntities |
| EntityID Scene::m_selectedEntity = -1 |
| bool Scene::m_showColliders = true |
| bool Scene::m_showGrid = true |