Path: /sdk/add_on/scripthelper/
These helper functions simplify the implementation of common tasks. They can be used as is or can serve as the starting point for your own framework.
Public C++ interface
int CompareRelation(
asIScriptEngine *engine,
void *leftObj,
void *rightObj,
int typeId,
int &result);
int CompareEquality(
asIScriptEngine *engine,
void *leftObj,
void *rightObj,
int typeId,
bool &result);
The interface to the virtual machine.
Definition: angelscript.h:2764
The engine interface.
Definition: angelscript.h:1125
The interface to the script modules.
Definition: angelscript.h:2261
The interface for the string factory.
Definition: angelscript.h:2193
Example
To compare two script objects the application can execute the following code:
{
int cmp;
int r = CompareRelation(engine, a, b, typeId, cmp);
if( r < 0 )
{
cout << "The relation between a and b cannot be established b" << endl;
}
else
{
if( cmp < 0 )
cout << "a is smaller than b" << endl;
else if( cmp == 0 )
cout << "a is equal to b" << endl;
else
cout << "a is greater than b" << endl;
}
}
The interface for an instance of a script object.
Definition: angelscript.h:3621
virtual int GetTypeId() const =0
Returns the type id of the object.
virtual asIScriptEngine * GetEngine() const =0
Return the script engine.