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