FEventsComponentEntity

namespace marengine
class FEventsComponentEntity
#include “Core/ecs/Entity/EventsComponentEntity.h”

FEventsComponentEntity is event class for entity components. With this we can define events for specific component action. Newly defined components should create own templated methods.

Public Static Functions

void passSceneManager(FSceneManagerEditor *pSceneManagerEditor)
void passRenderManager(FRenderManager *pRenderManager)
void passBatchManager(FBatchManager *pBatchManager)
void passMeshManager(FMeshManager *pMeshManager)
template<typename TComponent>
void onAdd(const Entity &entity)

Event called everytime, when TComponent is added to entity. Remember, method actually adds component! Also specific implementations should inform other instances, that are looking for those events.

Template Parameters
  • TComponent: structure type of component

Parameters
  • entity: entity, at which add component event is called

template<typename TComponent>
void onUpdate(const Entity &entity)

Event called everytime, when TComponent’s parameters are updated, and other instances should know it!

Template Parameters
  • TComponent: structure type of component

Parameters
  • entity: entity, at which update component event is called

template<typename TComponent>
void onRemove(const Entity &entity)

Event called everytime, when TComponent is removed from entity. Remember, method actually removes component! Specific implementations should inform other instances, that are looking for those events.

Template Parameters
  • TComponent: structure type of component

Parameters
  • entity: entity, at which remove component event is called

Private Static Attributes

FSceneManagerEditor *s_pSceneManagerEditor = {nullptr}
FRenderManager *s_pRenderManager = {nullptr}
FBatchManager *s_pBatchManager = {nullptr}
FMeshManager *s_pMeshManager = {nullptr}