RavEngine
Loading...
Searching...
No Matches
RavEngine::ScriptComponent Class Referenceabstract

#include <ScriptComponent.hpp>

Inheritance diagram for RavEngine::ScriptComponent:
[legend]
Collaboration diagram for RavEngine::ScriptComponent:
[legend]

Public Member Functions

 ScriptComponent (Entity owner)
 
virtual ~ScriptComponent ()
 
virtual void Start ()
 
virtual void Stop ()
 
virtual void Tick (float fpsScale)=0
 
Transform & GetTransform ()
 
- Public Member Functions inherited from RavEngine::ComponentWithOwner
 ComponentWithOwner (const decltype(owner) o)
 
Entity GetOwner () const
 

Additional Inherited Members

- Public Types inherited from RavEngine::Queryable< ScriptComponent >
typedef std::array< ctti_t, ntypes > arraytype
 
- Static Public Member Functions inherited from RavEngine::Queryable< ScriptComponent >
static constexpr const arraytype & GetQueryTypes ()
 
- Public Attributes inherited from RavEngine::Queryable< ScriptComponent >
constexpr q_qt_def
 
- Static Public Attributes inherited from RavEngine::Queryable< ScriptComponent >
static constexpr std::size_t ntypes
 
- Protected Attributes inherited from RavEngine::ComponentWithOwner
Entity owner
 

Detailed Description

Define an Entity-side Script which can contain code. Subclass to add behavior. Be sure to invoke the base class constructor!

Constructor & Destructor Documentation

◆ ~ScriptComponent()

virtual RavEngine::ScriptComponent::~ScriptComponent ( )
inlinevirtual

Override to provide cleanup behavior.

Member Function Documentation

◆ GetTransform()

Transform & RavEngine::ScriptComponent::GetTransform ( )

Shortcut to get the transform component of the attached entity

Exceptions
ifthe script is not attached to any entity.

◆ Start()

virtual void RavEngine::ScriptComponent::Start ( )
inlinevirtual

Invoked when the owning entity of this script has been added to the world.

◆ Stop()

virtual void RavEngine::ScriptComponent::Stop ( )
inlinevirtual

Called by the world when the owning entity has been despawned, but before despawn work has begun.

◆ Tick()

virtual void RavEngine::ScriptComponent::Tick ( float  fpsScale)
pure virtual

Invoked as the last step of the systems execution on a background thread. Any cross-object access must be appropriately protected.

Parameters
fpsScalethe frame rate scalar for this frame.

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