Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine.
GitHub | Vesper Updates | Creator
Loading...
Searching...
No Matches
Vesper::ScriptableEntity Class Reference

Base class for scriptable entities within a scene. More...

#include <ScriptableEntity.h>

Public Member Functions

virtual ~ScriptableEntity ()
template<typename T>
T & GetComponent ()
 Retrieves a reference to a component of type T attached to the entity.

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~ScriptableEntity()

virtual Vesper::ScriptableEntity::~ScriptableEntity ( )
inlinevirtual
13{};

Member Function Documentation

◆ GetComponent()

template<typename T>
T & Vesper::ScriptableEntity::GetComponent ( )
inline

Retrieves a reference to a component of type T attached to the entity.

Template Parameters
TThe type of the component to retrieve.
Returns
Reference to the component of type T. Will assert if the component does not exist.
22 {
23 return m_Entity.GetComponent<T>();
24 }
Entity m_Entity
Definition ScriptableEntity.h:45
@ T
Definition KeyCodes.h:57

◆ OnCreate()

virtual void Vesper::ScriptableEntity::OnCreate ( )
inlineprotectedvirtual

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.

31{}

◆ OnDestroy()

virtual void Vesper::ScriptableEntity::OnDestroy ( )
inlineprotectedvirtual

Called when the entity is destroyed.

Meant for internal use by the Scene class. Should be overridden in derived classes to handle cleanup.

37{}

◆ OnUpdate()

virtual void Vesper::ScriptableEntity::OnUpdate ( Timestep ts)
inlineprotectedvirtual

Called every frame to update the entity.

Parameters
tsThe timestep representing the time elapsed since the last update. Custom behavior should be implemented here in derived classes.
43{}

◆ Scene

friend class Scene
friend

Member Data Documentation

◆ m_Entity

Entity Vesper::ScriptableEntity::m_Entity
private

The documentation for this class was generated from the following file: