28 #include <boost/bind.hpp> 69 assert((fSig.
id ==
id) && (fDef.
id ==
id));
90 FunctionMan.registerFunction(fPtr.
name,
id, boost::bind(f,
this, _1), signature, defaults);
106 r += std::rand() % (max - min + 1) + min;
127 object->setPosition(x, y, z);
static Common::UString formatFloat(float f, int width=18, int decimals=9)
void jumpTo(KotOR2::Object *object, float x, float y, float z)
Aurora::NWScript::Type parameters[15]
void unimplementedFunction(Aurora::NWScript::FunctionContext &ctx)
const Aurora::NWScript::Variable * defaults[14]
std::vector< class Variable > Parameters
A class holding an UTF-8 string.
The context handling the gameplay in Star Wars: Knights of the Old Republic II - The Sith Lords...
Common::UString formatType(Type type)
Construct a string describing this variable type.
A container of Star Wars: Knights of the Old Republic II - The Sith Lords objects.
Aurora::NWScript::Type returnType
Object * getCaller() const
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
The context holding a Star Wars: Knights of the Old Republic II - The Sith Lords area.
static const FunctionSignature kFunctionSignatures[]
The table defining the signature (return type and type of parameters) of each engine function...
The NWScript function manager.
static int32 getRandom(int min, int max, int32 n=1)
const char * c_str() const
Return the (utf8 encoded) string data.
An object in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
static UString format(const char *s,...) GCC_PRINTF(1
Print formatted data into an UString object, similar to sprintf().
Utility templates and functions.
Basic Star Wars: Knights of the Old Republic II - The Sith Lords type definitions.
Star Wars: Knights of the Old Republic II - The Sith Lords engine functions.
Fake value to describe the calling object in a script.
std::vector< Type > Signature
const Common::UString & getName() const
void warning(const char *s,...)
The context needed to run a Star Wars: Knights of the Old Republic II - The Sith Lords module...
Tables defining the engine functions in Star Wars: Knights of the Old Republic II - The Sith Lords...
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
ObjectType getType() const
Return the exact type of the object.
static const FunctionDefaults kFunctionDefaults[]
The table defining the default values for the parameters of each engine function. ...
static KotOR2::Object * toObject(::Aurora::NWScript::Object *object)
void(Functions::* funcPtr)(Aurora::NWScript::FunctionContext &ctx)
Common::UString formatParams(const FunctionContext &ctx)
Construct a string describing parameters of this function.
static const FunctionPointer kFunctionPointers[]
The table defining the name and function pointer of each engine function.
NWScript utility functions.