|
Muto 0.0.1
|
Base class for scriptable entities within a scene. More...
#include <ScriptableEntity.h>
Public Member Functions | |
| template<typename T > | |
| T & | GetComponent () |
| Retrieves a reference to a component of type T attached to the entity. | |
| virtual | ~ScriptableEntity () |
Protected Member Functions | |
| virtual void | OnCreate () |
| Sets the entity associated with this scriptable entity. | |
| virtual void | OnDestroy () |
| Called when the entity is destroyed. | |
| virtual void | OnUpdate (Timestep ts) |
| Called every frame to update the entity. | |
Private Attributes | |
| Entity | m_Entity |
Friends | |
| class | Scene |
Base class for scriptable entities within a scene.
A ScriptableEntity allows for custom behavior to be defined for entities in a scene, not already provided as standardized components.
|
inlinevirtual |
|
inline |
Retrieves a reference to a component of type T attached to the entity.
| T | The type of the component to retrieve. |
References m_Entity.
Sets the entity associated with this scriptable entity.
Meant for internal use by the Scene class. Should be overridden in derived classes if additional setup is required when the entity is set.
Called when the entity is destroyed.
Meant for internal use by the Scene class. Should be overridden in derived classes to handle cleanup.
Called every frame to update the entity.
| ts | The timestep representing the time elapsed since the last update. Custom behavior should be implemented here in derived classes. |
|
private |
Referenced by GetComponent().