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::NativeScriptComponent Struct Reference

Component that holds scripting data for an entity. More...

#include <Components.h>

Public Member Functions

template<typename T>
void Bind ()
 Binds a script type to this component.

Public Attributes

ScriptableEntityInstance = nullptr
 Pointer to the instance of the scriptable entity.
ScriptableEntity *(* InstantiateScript )()
 Function pointer to instantiate the script.
void(* DestroyScript )(NativeScriptComponent *)
 Function pointer to destroy the script.

Detailed Description

Component that holds scripting data for an entity.

Member Function Documentation

◆ Bind()

template<typename T>
void Vesper::NativeScriptComponent::Bind ( )
inline

Binds a script type to this component.

Template Parameters
TThe type of the script to bind.
245 {
246 InstantiateScript = []() { return static_cast<ScriptableEntity*> (new T()); };
247 DestroyScript = [](NativeScriptComponent* nsc) { delete nsc->Instance; nsc->Instance = nullptr; };
248 }
@ T
Definition KeyCodes.h:57
void(* DestroyScript)(NativeScriptComponent *)
Function pointer to destroy the script.
Definition Components.h:238
ScriptableEntity *(* InstantiateScript)()
Function pointer to instantiate the script.
Definition Components.h:236

Member Data Documentation

◆ DestroyScript

void(* Vesper::NativeScriptComponent::DestroyScript) (NativeScriptComponent *)

Function pointer to destroy the script.

◆ Instance

ScriptableEntity* Vesper::NativeScriptComponent::Instance = nullptr

Pointer to the instance of the scriptable entity.

◆ InstantiateScript

ScriptableEntity *(* Vesper::NativeScriptComponent::InstantiateScript) ()

Function pointer to instantiate the script.


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