supertux
Public Member Functions | List of all members
ExposedObject< S, T > Class Template Reference

This class binds a certain GameObject class to a scripting class. More...

#include <exposed_object.hpp>

Inheritance diagram for ExposedObject< S, T >:
ScriptInterface

Public Member Functions

 ExposedObject (S *parent)
 Constructor. More...
 
virtual void expose (HSQUIRRELVM vm, SQInteger table_idx) override
 Exposes the parent GameObject to the script Interface. More...
 
virtual void unexpose (HSQUIRRELVM vm, SQInteger table_idx) override
 Un-exposes the parent GameObject to the script Interface. More...
 

Detailed Description

template<class S, class T>
class ExposedObject< S, T >

This class binds a certain GameObject class to a scripting class.

To bind a game object class to a scripting class, extend the GameObject class as shown in the following example:

and instantiate it in each constructor with the this pointer, like this:

Gradient::Gradient(const ReaderMapping& reader) :
Parameters
classS: GameObject class (e.g. Gradient)
classT: Scripting class (e.g. scripting::Gradient)

Constructor & Destructor Documentation

§ ExposedObject()

template<class S, class T>
ExposedObject< S, T >::ExposedObject ( S *  parent)
inline

Constructor.

Parameters
parentGameObject

Member Function Documentation

§ expose()

template<class S, class T>
virtual void ExposedObject< S, T >::expose ( HSQUIRRELVM  vm,
SQInteger  table_idx 
)
inlineoverridevirtual

Exposes the parent GameObject to the script Interface.

Parameters
vmThe squirrel virtual machine to expose the object on
table_idxIndex of the table to expose the object on

Implements ScriptInterface.

§ unexpose()

template<class S, class T>
virtual void ExposedObject< S, T >::unexpose ( HSQUIRRELVM  vm,
SQInteger  table_idx 
)
inlineoverridevirtual

Un-exposes the parent GameObject to the script Interface.

Parameters
vmThe squirrel virtual machine to un-expose the object on
table_idxIndex of the table to un-expose the object on

Implements ScriptInterface.


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