#include <ScriptController.h>
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) |
Controls and manages all scripts.
double gameplay::ScriptController::executeFunction< double > | ( | const char * | func | ) |
Calls a zero-parameter global function.
func | The name of the function to call. |
Template specialization.
T gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Calls a zero-parameter function.
script | The script to execute the function on, or NULL for the global script environment. |
func | The name of the function to call. |
T gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Calls a global function using the given 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:
|
... | Parameters to pass to the script fucntion, as specified by the args parameter. |
T gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Calls the a function from the specified script, using the given 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:
|
... | Parameters to pass to the script fucntion, as specified by the args parameter. |
T gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Calls the specified global Lua function using the given 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:
|
list | The variable argument list containing the function's parameters, or NULL for an empty parameter list. |
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.
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:
|
list | The variable argument list containing the function's parameters, or NULL for an empty parameter list. |
void gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
bool gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
char gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
short gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
int gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
long gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
unsigned char gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
unsigned short gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
unsigned int gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
unsigned long gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
float gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
double gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func | ||
) |
Template specialization.
void gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
bool gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
char gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
short gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
int gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
long gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned char gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned short gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned int gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned long gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
float gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
double gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
... | |||
) |
Template specialization.
void gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
bool gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
char gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
short gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
int gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
long gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned char gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned short gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned int gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
unsigned long gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
float gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
double gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
... | |||
) |
Template specialization.
void gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
bool gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
char gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
short gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
int gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
long gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned char gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned short gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned int gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned long gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
float gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
double gameplay::ScriptController::executeFunction | ( | const char * | func, |
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
void gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
bool gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
char gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
short gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
int gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
long gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned char gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned short gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned int gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
unsigned long gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
float gameplay::ScriptController::executeFunction | ( | Script * | script, |
const char * | func, | ||
const char * | args, | ||
va_list * | list | ||
) |
Template specialization.
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.
name | The name of the function to check. |
script | Optional script to inspect, or NULL to inspect the global script environment. |
bool gameplay::ScriptController::getBool | ( | const char * | name, |
bool | defaultValue = false , |
||
Script * | script = NULL |
||
) |
Gets the global boolean script variable with the given name.
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. |
char gameplay::ScriptController::getChar | ( | const char * | name, |
char | defaultValue = 0 , |
||
Script * | script = NULL |
||
) |
Gets the global char script variable with the given name.
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 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.
double gameplay::ScriptController::getDouble | ( | const char * | name, |
double | defaultValue = 0 , |
||
Script * | script = NULL |
||
) |
Gets the global double script variable with the given name.
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. |
float gameplay::ScriptController::getFloat | ( | const char * | name, |
float | defaultValue = 0 , |
||
Script * | script = NULL |
||
) |
Gets the global float script variable with the given name.
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. |
int gameplay::ScriptController::getInt | ( | const char * | name, |
int | defaultValue = 0 , |
||
Script * | script = NULL |
||
) |
Gets the global int script variable with the given name.
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. |
long gameplay::ScriptController::getLong | ( | const char * | name, |
long | defaultValue = 0 , |
||
Script * | script = NULL |
||
) |
Gets the global long script variable with the given name.
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. |
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.
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. |
short gameplay::ScriptController::getShort | ( | const char * | name, |
short | defaultValue = 0 , |
||
Script * | script = NULL |
||
) |
Gets the global short script variable with the given name.
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. |
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.
name | The name of the variable. |
script | Optional script to use, or NULL for the global script environment. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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). |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
name | The name of the script variable. |
v | The unsigned short value. |
script | Optional script to use, or NULL for the global script environment. |