Torque2D Reference
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Typedefs
Scripting Engine Callbacks

Typedefs

typedef const char *(* StringCallback )(SimObject *obj, S32 argc, const char *argv[])
 
typedef S32(* IntCallback )(SimObject *obj, S32 argc, const char *argv[])
 
typedef F32(* FloatCallback )(SimObject *obj, S32 argc, const char *argv[])
 
typedef void(* VoidCallback )(SimObject *obj, S32 argc, const char *argv[])
 
typedef bool(* BoolCallback )(SimObject *obj, S32 argc, const char *argv[])
 
typedef void(* ConsumerCallback )(ConsoleLogEntry::Level level, const char *consoleLine)
 

Detailed Description

The scripting engine makes heavy use of callbacks to represent function exposed to the scripting language. StringCallback, IntCallback, FloatCallback, VoidCallback, and BoolCallback all represent exposed script functions returning different types.

ConsumerCallback is used with the function Con::addConsumer; functions registered with Con::addConsumer are called whenever something is outputted to the console. For instance, the TelnetConsole registers itself with the console so it can echo the console over the network.

Note
Callbacks to the scripting language - for instance, onExit(), which is a script function called when the engine is shutting down - are handled using Con::executef() and kin.

Typedef Documentation

typedef bool(* BoolCallback)(SimObject *obj, S32 argc, const char *argv[])
typedef void(* ConsumerCallback)(ConsoleLogEntry::Level level, const char *consoleLine)
typedef F32(* FloatCallback)(SimObject *obj, S32 argc, const char *argv[])
typedef S32(* IntCallback)(SimObject *obj, S32 argc, const char *argv[])
typedef const char*(* StringCallback)(SimObject *obj, S32 argc, const char *argv[])
typedef void(* VoidCallback)(SimObject *obj, S32 argc, const char *argv[])