This is a unique Component, as no Entities will register with it and it contains no per-entity data. Its use is to provide a central location for other Components to easily access game services and managers (since Components themselves do not have direct access to the game state, but do have access to other Components).
|
| CommonServicesComponent () |
| The default constructor to create an empty CommonServicesComponent.
|
|
virtual | ~CommonServicesComponent () |
| Destructor for CommonServicesComponent.
|
|
void | Initialize (fplbase::AssetManager *asset_manager, EntityFactory *entity_factory, breadboard::GraphFactory *graph_factory, fplbase::InputSystem *input_system, fplbase::Renderer *renderer) |
| Initializes the CommonServicesComponent with pointers to the various game services and managers. More...
|
|
fplbase::AssetManager * | asset_manager () |
|
breadboard::GraphFactory * | graph_factory () |
|
fplbase::InputSystem * | input_system () |
|
EntityFactory * | entity_factory () |
|
fplbase::Renderer * | renderer () |
|
void | AddFromRawData (corgi::EntityRef &, const void *) |
| This component should never be added to an Entity. It is only provided as an interface for other components to access common game resources. More...
|
|
bool | export_force_defaults () const |
| This should be called when Components are exporting their data to a FlatBuffer. It indicates if the FlatBuffer should include default values in the serialized data. More...
|
|
void | set_export_force_defaults (bool b) |
| Set a flag to determine if Components, when exporting their data to FlatBuffers, should include default values in the serialized data. More...
|
|
| Component () |
| Construct a Component without an EntityManager.
|
|
virtual | ~Component () |
| Destructor for a Component.
|
|
virtual void | AddEntityGenerically (EntityRef &entity) |
| Provides an alternate way to add Entities if you do not care about the returned data structure, and if you do not feel like casting the BaseComponent into something more specific. More...
|
|
CommonServicesData * | AddEntity (EntityRef &entity, AllocationLocation alloc_location) |
| Adds an Entity to the list that this Component is tracking. More...
|
|
CommonServicesData * | AddEntity (EntityRef &entity) |
| Adds an Entity to the list that this Component is tracking. More...
|
|
virtual void | RemoveEntity (EntityRef &entity) |
| Removes an Entity from the list of Entities. More...
|
|
virtual EntityIterator | RemoveEntity (EntityIterator iter) |
| Removes an Entity from the list of Entities. More...
|
|
virtual EntityIterator | begin () |
| Gets an iterator that will iterate over every Entity associated with the Component, starting from the beginning. More...
|
|
virtual EntityIterator | end () |
| Gets an iterator that points to the end of the list of all entites in the Component. More...
|
|
virtual void | UpdateAllEntities (WorldTime) |
| Updates all Entities. This is normally called, once per frame, by the EntityManager.
|
|
virtual bool | HasDataForEntity (const EntityRef &entity) |
| Checks if this component contains any data associated with the supplied entity.
|
|
virtual void * | GetComponentDataAsVoid (const EntityRef &entity) |
| Gets the data for a given Entity as a void pointer. More...
|
|
virtual const void * | GetComponentDataAsVoid (const EntityRef &entity) const |
| Gets the data for a given Entity as a const void pointer. More...
|
|
CommonServicesData * | GetComponentData (size_t data_index) |
| Gets the Component data stored at a given index. More...
|
|
CommonServicesData * | GetComponentData (const EntityRef &entity) |
| Gets the data for a given Entity. More...
|
|
const CommonServicesData * | GetComponentData (size_t data_index) const |
| Gets the Component data stored at a given index. More...
|
|
const CommonServicesData * | GetComponentData (const EntityRef &entity) const |
| Gets the data for a given Entity. More...
|
|
virtual void | ClearComponentData () |
| Clears all tracked Component data.
|
|
ComponentDataType * | Data (const EntityRef &entity) |
| A utility function for retrieving the Component data for an Entity from a specific Component. More...
|
|
ComponentDataType * | Data (const EntityRef &entity) const |
| A utility function for retrieving the Component data for an Entity from a specific Component. More...
|
|
bool | IsRegisteredWithComponent (const EntityRef &entity) |
| A utility function for checking if an entity is registered with a particular component. More...
|
|
ComponentDataType * | GetComponent () |
| A utility function for retrieving a reference to a specific Component object, by type. More...
|
|
virtual void | Init () |
| Override this function with code that should be executed when the Component is added to the EntityManager. (This typically happens once, at the beginning of the game before any Entities are added.)
|
|
virtual void | InitEntity (EntityRef &) |
| Override this function with code that should be executed when an Entity is added to the Component.
|
|
virtual RawDataUniquePtr | ExportRawData (const EntityRef &) const |
| Override this function to return raw data that can be read back later. More...
|
|
virtual void | Cleanup () |
| Override this function with any code that executes when this Component is removed from the EntityManager. (i.e. Usually when the game/state is over and everything is shutting down.)
|
|
virtual void | CleanupEntity (EntityRef &) |
| Override this function with any code that needs to be executed when an Entity is removed from this Component.
|
|
virtual void | SetEntityManager (EntityManager *entity_manager) |
| Set the EntityManager for this Component. More...
|
|
virtual void | SetComponentIdOnDataType (ComponentId id) |
| Sets the Component ID on the data type. More...
|
|
virtual | ~ComponentInterface () |
| A destructor for the Component interface.
|
|
|
typedef VectorPool
< ComponentData >::Iterator | EntityIterator |
| An iterator to iterate through all of the Entities in the Component.
|
|
typedef CommonServicesData | value_type |
| The templated data type stored by this Component.
|
|
typedef std::unique_ptr
< uint8_t, std::function< void(uint8_t *)> > | RawDataUniquePtr |
| A pointer type for exported raw data.
|
|
static ComponentId | GetComponentId () |
| Get the ID for this Component. More...
|
|
size_t | GetComponentDataIndex (const EntityRef &entity) const |
| Get the index of the Component data for a given Entity. More...
|
|
VectorPool< ComponentData > | component_data_ |
| Storage for all of the data for the Component.
|
|
EntityManager * | entity_manager_ |
| A pointer to the EntityManager for this Component. This is the main point of contact for Components that need to talk to other things.
|
|
std::unordered_map
< EntityIdType, ComponentIndex > | component_index_lookup_ |
| A map, for translating unique entity IDs into vectorpool indexes.
|
|