|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Member Functions | Static Public Member Functions
gameplay::ScriptController Class Reference

`#include <ScriptController.h>`

List of all members.

## Classes

struct | ScriptTimeListener

## Public Member Functions

Script * | loadScript (const char *path, Script::Scope scope=Script::GLOBAL, bool forceReload=false)
template<typename T >
T | executeFunction (const char *func)
template<typename T >
T | executeFunction (Script *script, const char *func)
template<typename T >
T | executeFunction (const char *func, const char *args,...)
template<typename T >
T | executeFunction (Script *script, const char *func, const char *args,...)
template<typename T >
T | executeFunction (const char *func, const char *args, va_list *list)
template<typename T >
T | executeFunction (Script *script, const char *func, const char *args, va_list *list)
bool | getBool (const char *name, bool defaultValue=false, Script *script=NULL)
char | getChar (const char *name, char defaultValue=0, Script *script=NULL)
short | getShort (const char *name, short defaultValue=0, Script *script=NULL)
int | getInt (const char *name, int defaultValue=0, Script *script=NULL)
long | getLong (const char *name, long defaultValue=0, Script *script=NULL)
unsigned char | getUnsignedChar (const char *name, unsigned char defaultValue=0, Script *script=NULL)
unsigned short | getUnsignedShort (const char *name, unsigned short defaultValue=0, Script *script=NULL)
unsigned int | getUnsignedInt (const char *name, unsigned int defaultValue=0, Script *script=NULL)
unsigned long | getUnsignedLong (const char *name, unsigned long defaultValue=0, Script *script=NULL)
float | getFloat (const char *name, float defaultValue=0, Script *script=NULL)
double | getDouble (const char *name, double defaultValue=0, Script *script=NULL)
const char * | getString (const char *name, Script *script=NULL)
void * | getObjectPointer (const char *type, const char *name, Script *script=NULL)
void | setBool (const char *name, bool v, Script *script=NULL)
void | setChar (const char *name, char v, Script *script=NULL)
void | setShort (const char *name, short v, Script *script=NULL)
void | setInt (const char *name, int v, Script *script=NULL)
void | setLong (const char *name, long v, Script *script=NULL)
void | setUnsignedChar (const char *name, unsigned char v, Script *script=NULL)
void | setUnsignedShort (const char *name, unsigned short v, Script *script=NULL)
void | setUnsignedInt (const char *name, unsigned int v, Script *script=NULL)
void | setUnsignedLong (const char *name, unsigned long v, Script *script=NULL)
void | setFloat (const char *name, float v, Script *script=NULL)
void | setDouble (const char *name, double v, Script *script=NULL)
void | setString (const char *name, const char *v, Script *script=NULL)
void | setObjectPointer (const char *type, const char *name, void *v, Script *script=NULL)
bool | functionExists (const char *name, const Script *script=NULL) const
Script * | getCurrentScript () const
template<>
void | executeFunction (Script *script, const char *func)
template<>
bool | executeFunction (Script *script, const char *func)
template<>
char | executeFunction (Script *script, const char *func)
template<>
short | executeFunction (Script *script, const char *func)
template<>
int | executeFunction (Script *script, const char *func)
template<>
long | executeFunction (Script *script, const char *func)
template<>
unsigned char | executeFunction (Script *script, const char *func)
template<>
unsigned short | executeFunction (Script *script, const char *func)
template<>
unsigned int | executeFunction (Script *script, const char *func)
template<>
unsigned long | executeFunction (Script *script, const char *func)
template<>
float | executeFunction (Script *script, const char *func)
template<>
double | executeFunction (Script *script, const char *func)
template<>
void | executeFunction (const char *func, const char *args,...)
template<>
bool | executeFunction (const char *func, const char *args,...)
template<>
char | executeFunction (const char *func, const char *args,...)
template<>
short | executeFunction (const char *func, const char *args,...)
template<>
int | executeFunction (const char *func, const char *args,...)
template<>
long | executeFunction (const char *func, const char *args,...)
template<>
unsigned char | executeFunction (const char *func, const char *args,...)
template<>
unsigned short | executeFunction (const char *func, const char *args,...)
template<>
unsigned int | executeFunction (const char *func, const char *args,...)
template<>
unsigned long | executeFunction (const char *func, const char *args,...)
template<>
float | executeFunction (const char *func, const char *args,...)
template<>
double | executeFunction (const char *func, const char *args,...)
template<>
void | executeFunction (Script *script, const char *func, const char *args,...)
template<>
bool | executeFunction (Script *script, const char *func, const char *args,...)
template<>
char | executeFunction (Script *script, const char *func, const char *args,...)
template<>
short | executeFunction (Script *script, const char *func, const char *args,...)
template<>
int | executeFunction (Script *script, const char *func, const char *args,...)
template<>
long | executeFunction (Script *script, const char *func, const char *args,...)
template<>
unsigned char | executeFunction (Script *script, const char *func, const char *args,...)
template<>
unsigned short | executeFunction (Script *script, const char *func, const char *args,...)
template<>
unsigned int | executeFunction (Script *script, const char *func, const char *args,...)
template<>
unsigned long | executeFunction (Script *script, const char *func, const char *args,...)
template<>
float | executeFunction (Script *script, const char *func, const char *args,...)
template<>
double | executeFunction (Script *script, const char *func, const char *args,...)
template<>
void | executeFunction (const char *func, const char *args, va_list *list)
template<>
bool | executeFunction (const char *func, const char *args, va_list *list)
template<>
char | executeFunction (const char *func, const char *args, va_list *list)
template<>
short | executeFunction (const char *func, const char *args, va_list *list)
template<>
int | executeFunction (const char *func, const char *args, va_list *list)
template<>
long | executeFunction (const char *func, const char *args, va_list *list)
template<>
unsigned char | executeFunction (const char *func, const char *args, va_list *list)
template<>
unsigned short | executeFunction (const char *func, const char *args, va_list *list)
template<>
unsigned int | executeFunction (const char *func, const char *args, va_list *list)
template<>
unsigned long | executeFunction (const char *func, const char *args, va_list *list)
template<>
float | executeFunction (const char *func, const char *args, va_list *list)
template<>
double | executeFunction (const char *func, const char *args, va_list *list)
template<>
void | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
bool | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
char | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
short | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
int | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
long | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
unsigned char | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
unsigned short | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
unsigned int | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
unsigned long | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
float | executeFunction (Script *script, const char *func, const char *args, va_list *list)
template<>
double | executeFunction (Script *script, const char *func, const char *args, va_list *list)

## Static Public Member Functions

static void | print (const char *str)
static void | print (const char *str1, const char *str2)

## Detailed Description

Controls and manages all scripts.

## Member Function Documentation

double gameplay::ScriptController::executeFunction< double > | ( | const char * | func | ) |

Calls a zero-parameter global function.

Parameters:

  func | The name of the function to call.

Returns:
  The return value of the executed Lua function.

Template specialization.

template<typename T >

T gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Calls a zero-parameter function.

Parameters:

  script | The script to execute the function on, or NULL for the global script environment.
  func | The name of the function to call.

Returns:
  The return value of the executed Lua function.

template<typename T >

T gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Calls a global function using the given parameters.

Parameters:

  func | The name of the function to call.

  args

  The argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of:
  - 'b' - bool
  - 'c' - char
  - 'h' - short
  - 'i' - int
  - 'l' - long
  - 'f' - float
  - 'd' - double
  - 'ui' - unsigned int
  - 'ul' - unsigned long
  - 'uc' - unsigned char
  - 'uh' - unsigned short
  - 's' - string
  - 'p' - pointer
  - '<object-type>' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets).
  - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets).

  ... | Parameters to pass to the script fucntion, as specified by the args parameter.

Returns:
  The return value of the executed Lua function.

template<typename T >

T gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Calls the a function from the specified script, using the given parameters.

Parameters:

  script | The script to execute the function on, or NULL for the global script environment.
  func | The name of the function to call.

  args

  The argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of:
  - 'b' - bool
  - 'c' - char
  - 'h' - short
  - 'i' - int
  - 'l' - long
  - 'f' - float
  - 'd' - double
  - 'ui' - unsigned int
  - 'ul' - unsigned long
  - 'uc' - unsigned char
  - 'uh' - unsigned short
  - 's' - string
  - 'p' - pointer
  - '<object-type>' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets).
  - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets).

  ... | Parameters to pass to the script fucntion, as specified by the args parameter.

Returns:
  The return value of the executed Lua function.

template<typename T >

T gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Calls the specified global Lua function using the given parameters.

Parameters:

  func | The name of the function to call.

  args

  The optional argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of:
  - 'b' - bool
  - 'c' - char
  - 'h' - short
  - 'i' - int
  - 'l' - long
  - 'f' - float
  - 'd' - double
  - 'ui' - unsigned int
  - 'ul' - unsigned long
  - 'uc' - unsigned char
  - 'uh' - unsigned short
  - 's' - string
  - 'p' - pointer
  - '<object-type>' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets).
  - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets).

  list | The variable argument list containing the function's parameters, or NULL for an empty parameter list.

Returns:
  The return value of the executed Lua function.

template<typename T >

T gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Calls the specified global Lua function using the given parameters.

Parameters:

  script | Optional script to use, or NULL for the global script environment.
  func | The name of the function to call.

  args

  The optional argument signature of the function. Of the form 'xxx', where each 'x' is a parameter type and must be one of:
  - 'b' - bool
  - 'c' - char
  - 'h' - short
  - 'i' - int
  - 'l' - long
  - 'f' - float
  - 'd' - double
  - 'ui' - unsigned int
  - 'ul' - unsigned long
  - 'uc' - unsigned char
  - 'uh' - unsigned short
  - 's' - string
  - 'p' - pointer
  - '<object-type>' - a pointer to an object of the given type (where the qualified type name is enclosed by angle brackets).
  - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets).

  list | The variable argument list containing the function's parameters, or NULL for an empty parameter list.

Returns:
  The return value of the executed Lua function.

template<>

void gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

bool gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

char gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

short gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

int gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

long gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

unsigned char gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

unsigned short gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

unsigned int gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

unsigned long gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

float gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

double gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func
| ) |  |

Template specialization.

template<>

void gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

bool gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

char gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

short gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

int gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

long gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned char gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned short gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned int gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned long gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

float gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

double gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

void gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

bool gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

char gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

short gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

int gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

long gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned char gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned short gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned int gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

unsigned long gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

float gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

double gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  |  | ...
| ) |  |

Template specialization.

template<>

void gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

bool gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

char gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

short gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

int gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

long gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned char gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned short gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned int gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned long gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

float gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

double gameplay::ScriptController::executeFunction | ( | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

void gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

bool gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

char gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

short gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

int gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

long gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned char gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned short gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned int gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

unsigned long gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

float gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

template<>

double gameplay::ScriptController::executeFunction | ( | Script * | script,
|  | const char * | func,
|  | const char * | args,
|  | va_list * | list
| ) |  |

Template specialization.

bool gameplay::ScriptController::functionExists | ( | const char * | name,
|  | const Script * | script = `NULL`
| ) |  | const

Determines if there exists a function with the specified name in the given script environment.

Parameters:

  name | The name of the function to check.
  script | Optional script to inspect, or NULL to inspect the global script environment.

Returns:
  True if the specified function exists, false otherwise.

bool gameplay::ScriptController::getBool | ( | const char * | name,
|  | bool | defaultValue = `false`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global boolean script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a bool.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global boolean script variable.

char gameplay::ScriptController::getChar | ( | const char * | name,
|  | char | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global char script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global char script variable.

Script* gameplay::ScriptController::getCurrentScript | ( |  | ) | const

Returns the currently executing script.

Note that this function returns the currently executing Script object, which is not guaranteed to be valid unless the returned script's reference count is increased while the caller holds onto it.

Returns:
  The currently executing script, or NULL if either there is no currently executing script or the global script environment is current.

double gameplay::ScriptController::getDouble | ( | const char * | name,
|  | double | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global double script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global double script variable.

float gameplay::ScriptController::getFloat | ( | const char * | name,
|  | float | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global float script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global float script variable.

int gameplay::ScriptController::getInt | ( | const char * | name,
|  | int | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global int script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global int script variable.

long gameplay::ScriptController::getLong | ( | const char * | name,
|  | long | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global long script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global long script variable.

void* gameplay::ScriptController::getObjectPointer | ( | const char * | type,
|  | const char * | name,
|  | Script * | script = `NULL`
| ) |  |

Gets the global pointer script variable of the given type with the given name.

Parameters:

  type | The type of the variable in Lua.
  name | The name of the variable.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global pointer script variable.

short gameplay::ScriptController::getShort | ( | const char * | name,
|  | short | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global short script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global short script variable.

const char* gameplay::ScriptController::getString | ( | const char * | name,
|  | Script * | script = `NULL`
| ) |  |

Gets the global string variable with the given name.

The returned character string is temporary and is not gauranteed to live forever, therefore you should not store a pointer to the returned value. If long-term access to the returned string is required, it should be copied into another string for storage.

Parameters:

  name | The name of the variable.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The string variable or NULL if the variable is not a string.

unsigned char gameplay::ScriptController::getUnsignedChar | ( | const char * | name,
|  | unsigned char | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global unsigned char script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global unsigned char script variable.

unsigned int gameplay::ScriptController::getUnsignedInt | ( | const char * | name,
|  | unsigned int | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global unsigned int script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global unsigned int script variable.

unsigned long gameplay::ScriptController::getUnsignedLong | ( | const char * | name,
|  | unsigned long | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global unsigned long script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global unsigned long script variable.

unsigned short gameplay::ScriptController::getUnsignedShort | ( | const char * | name,
|  | unsigned short | defaultValue = `0`,
|  | Script * | script = `NULL`
| ) |  |

Gets the global unsigned short script variable with the given name.

Parameters:

  name | The name of the variable.
  defaultValue | The default value to return if the variable is not a number.
  script | Optional script to use, or NULL for the global script environment.

Returns:
  The global unsigned short script variable.

Script* gameplay::ScriptController::loadScript | ( | const char * | path,
|  | Script::Scope | scope = `Script::GLOBAL`,
|  | bool | forceReload = `false`
| ) |  |

Loads the given script file and executes its code (if it is not alreay loaded).

The script is loaded into an environment that is defined by the scope parameter. If the script scope is GLOBAL and the forceReload parameter is false, a previously-loaded script object may be returned. PROTECTED scope always results in a new script being loaded and executed.

Parameters:

  path | The path to the script.
  scope | The scope for the script to be executed in.
  forceReload | Whether the script should be reloaded if it has already been loaded (applicable for GLOBAL scripts only).

Returns:
  The loaded script, or NULL if the script could not be loaded.

static void gameplay::ScriptController::print | ( | const char * | str | ) | `[static]`

Prints the string to the platform's output stream or log file. Used for overriding Lua's print function.

Parameters:

  str | The string to print.

static void gameplay::ScriptController::print | ( | const char * | str1,
|  | const char * | str2
| ) |  | `[static]`

Prints the strings to the platform's output stream or log file. Used for overriding Lua's print function.

Parameters:

  str1 | The first string to print.
  str2 | The second string to print on the same line as str1.

void gameplay::ScriptController::setBool | ( | const char * | name,
|  | bool | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global boolean script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The boolean value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setChar | ( | const char * | name,
|  | char | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global char script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The char value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setDouble | ( | const char * | name,
|  | double | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global double script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The double value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setFloat | ( | const char * | name,
|  | float | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global float script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The float value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setInt | ( | const char * | name,
|  | int | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global int script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The int value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setLong | ( | const char * | name,
|  | long | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global long script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The long value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setObjectPointer | ( | const char * | type,
|  | const char * | name,
|  | void * | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global pointer script variable of the given type with the given name to the given value.

When passing an argument for the 'v' parameter, it is recommended that the object passed in be converted to void* using 'dynamic_cast<void*>(o)', to ensure that the address of the most derived class possible be stored. In this case, the 'type' parameter should also be set to the most derived type to ensure that the full set of methods for that object are available to the script engine.

Parameters:

  type | The type of the object point value being set.
  name | The name of the variable.
  v | The pointer value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setShort | ( | const char * | name,
|  | short | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global short script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The short value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setString | ( | const char * | name,
|  | const char * | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global string script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The string value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setUnsignedChar | ( | const char * | name,
|  | unsigned char | v,
|  | Script * | script = `NULL`
| ) |  |

Gets the global unsigned char script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The unsigned char value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setUnsignedInt | ( | const char * | name,
|  | unsigned int | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global unsigned int script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The unsigned int value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setUnsignedLong | ( | const char * | name,
|  | unsigned long | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global unsigned long script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The unsigned long value.
  script | Optional script to use, or NULL for the global script environment.

void gameplay::ScriptController::setUnsignedShort | ( | const char * | name,
|  | unsigned short | v,
|  | Script * | script = `NULL`
| ) |  |

Sets the global unsigned short script variable with the given name to the given value.

Parameters:

  name | The name of the script variable.
  v | The unsigned short value.
  script | Optional script to use, or NULL for the global script environment.

All Classes Functions Variables Typedefs Enumerations Enumerator