xoreos  0.0.5
functions.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_DRAGONAGE_SCRIPT_FUNCTIONS_H
26 #define ENGINES_DRAGONAGE_SCRIPT_FUNCTIONS_H
27 
29 
30 namespace Aurora {
31  namespace NWScript {
32  class FunctionContext;
33  class Object;
34  }
35 }
36 
37 namespace Engines {
38 
39 namespace DragonAge {
40 
41 class Game;
42 class Object;
43 
44 class Functions {
45 public:
46  Functions(Game &game);
47  ~Functions();
48 
49 private:
51 
52  struct FunctionPointer {
54  const char *name;
56  };
57 
62  };
63 
67  };
68 
72 
73 
75 
76  void registerFunctions();
77 
78  // .--- Utility methods
79  void jumpTo(DragonAge::Object *object, float x, float y, float z);
80 
81  static Common::UString formatFloat(float f, int width = 18, int decimals = 9);
82 
84  // '---
85 
86  // --- Engine functions ---
87 
89 
90  // .--- Math, functions_math.cpp
93 
97 
101 
105 
108 
111 
113 
115 
118 
120  // '---
121 
122  // .--- Strings, functions_string.cpp
125 
128 
131 
138 
144 
146 
148 
152 
155 
158 
161 
164 
168 
171 
174  // '---
175 
176  // .--- Module functions, functions_module.cpp
178 
180  // '---
181 
182  // .--- General object functions, functions_object.cpp
184 
195 
197 
208 
210 
212 
217 
220 
222 
224 
227 
229  // '---
230 
231  // .--- Creatures, functions_creature.cpp
233  // '---
234 
235  // .--- Events, functions_event.cpp
237 
239 
243 
246 
248  // '---
249 };
250 
251 } // End of namespace DragonAge
252 
253 } // End of namespace Engines
254 
255 #endif // ENGINES_DRAGONAGE_SCRIPT_FUNCTIONS_H
void sin(Aurora::NWScript::FunctionContext &ctx)
void asin(Aurora::NWScript::FunctionContext &ctx)
void isObjectValid(Aurora::NWScript::FunctionContext &ctx)
void getLocalFloat(Aurora::NWScript::FunctionContext &ctx)
void isEventValid(Aurora::NWScript::FunctionContext &ctx)
void randomFloat(Aurora::NWScript::FunctionContext &ctx)
void getEventCreator(Aurora::NWScript::FunctionContext &ctx)
void stringRight(Aurora::NWScript::FunctionContext &ctx)
void getArraySize(Aurora::NWScript::FunctionContext &ctx)
void getObjectByTag(Aurora::NWScript::FunctionContext &ctx)
void toString(Aurora::NWScript::FunctionContext &ctx)
void setName(Aurora::NWScript::FunctionContext &ctx)
void random(Aurora::NWScript::FunctionContext &ctx)
A class holding an UTF-8 string.
Definition: ustring.h:48
void floatToString(Aurora::NWScript::FunctionContext &ctx)
void cos(Aurora::NWScript::FunctionContext &ctx)
void UT_getNearestObjectByTag(Aurora::NWScript::FunctionContext &ctx)
void getLocalResource(Aurora::NWScript::FunctionContext &ctx)
void intToString(Aurora::NWScript::FunctionContext &ctx)
void setEventType(Aurora::NWScript::FunctionContext &ctx)
void setLocalFloat(Aurora::NWScript::FunctionContext &ctx)
void printInteger(Aurora::NWScript::FunctionContext &ctx)
void unimplementedFunction(Aurora::NWScript::FunctionContext &ctx)
Definition: functions.cpp:92
void getStringLength(Aurora::NWScript::FunctionContext &ctx)
void handleEvent(Aurora::NWScript::FunctionContext &ctx)
void subString(Aurora::NWScript::FunctionContext &ctx)
void logTrace(Aurora::NWScript::FunctionContext &ctx)
void setLocalItemProperty(Aurora::NWScript::FunctionContext &ctx)
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
Definition: functions.cpp:101
void fabs(Aurora::NWScript::FunctionContext &ctx)
void setLocalLocation(Aurora::NWScript::FunctionContext &ctx)
void isStringEmpty(Aurora::NWScript::FunctionContext &ctx)
void setLocalResource(Aurora::NWScript::FunctionContext &ctx)
void stringToInt(Aurora::NWScript::FunctionContext &ctx)
static const FunctionPointer kFunctionPointers[]
The table defining the name and function pointer of each engine function.
Definition: functions.h:69
void setLocalEffect(Aurora::NWScript::FunctionContext &ctx)
void getHero(Aurora::NWScript::FunctionContext &ctx)
void charToInt(Aurora::NWScript::FunctionContext &ctx)
void getLocalEffect(Aurora::NWScript::FunctionContext &ctx)
const Aurora::NWScript::Variable * defaults[7]
Definition: functions.h:66
void printString(Aurora::NWScript::FunctionContext &ctx)
void getCurrentScriptResource(Aurora::NWScript::FunctionContext &ctx)
void getLocalInt(Aurora::NWScript::FunctionContext &ctx)
void atan(Aurora::NWScript::FunctionContext &ctx)
void getDistanceBetween(Aurora::NWScript::FunctionContext &ctx)
void getLocalItemProperty(Aurora::NWScript::FunctionContext &ctx)
void getObjectType(Aurora::NWScript::FunctionContext &ctx)
void getLocalString(Aurora::NWScript::FunctionContext &ctx)
void vectorToString(Aurora::NWScript::FunctionContext &ctx)
void setLocalCommand(Aurora::NWScript::FunctionContext &ctx)
void printToLog(Aurora::NWScript::FunctionContext &ctx)
void intToFloat(Aurora::NWScript::FunctionContext &ctx)
void getPosition(Aurora::NWScript::FunctionContext &ctx)
void printVector(Aurora::NWScript::FunctionContext &ctx)
void tan(Aurora::NWScript::FunctionContext &ctx)
void setLocalString(Aurora::NWScript::FunctionContext &ctx)
void getEventType(Aurora::NWScript::FunctionContext &ctx)
void getTlkTableString(Aurora::NWScript::FunctionContext &ctx)
static Common::UString formatFloat(float f, int width=18, int decimals=9)
Definition: functions.cpp:97
void abs(Aurora::NWScript::FunctionContext &ctx)
void sqrt(Aurora::NWScript::FunctionContext &ctx)
void getModule(Aurora::NWScript::FunctionContext &ctx)
void getStringByStringId(Aurora::NWScript::FunctionContext &ctx)
void resourceToString(Aurora::NWScript::FunctionContext &ctx)
void(Functions::* funcPtr)(Aurora::NWScript::FunctionContext &ctx)
Definition: functions.h:50
void getCurrentEvent(Aurora::NWScript::FunctionContext &ctx)
void getLocalObject(Aurora::NWScript::FunctionContext &ctx)
void setLocalObject(Aurora::NWScript::FunctionContext &ctx)
void getEventTarget(Aurora::NWScript::FunctionContext &ctx)
void getTag(Aurora::NWScript::FunctionContext &ctx)
void floatToInt(Aurora::NWScript::FunctionContext &ctx)
void getLocalCommand(Aurora::NWScript::FunctionContext &ctx)
void intToChar(Aurora::NWScript::FunctionContext &ctx)
void printResource(Aurora::NWScript::FunctionContext &ctx)
void intToHexString(Aurora::NWScript::FunctionContext &ctx)
void stringLowerCase(Aurora::NWScript::FunctionContext &ctx)
void getLocalPlayer(Aurora::NWScript::FunctionContext &ctx)
void findSubString(Aurora::NWScript::FunctionContext &ctx)
void log(Aurora::NWScript::FunctionContext &ctx)
void setLocalPlayer(Aurora::NWScript::FunctionContext &ctx)
void stringUpperCase(Aurora::NWScript::FunctionContext &ctx)
void stringToFloat(Aurora::NWScript::FunctionContext &ctx)
uint32_t uint32
Definition: types.h:204
void acos(Aurora::NWScript::FunctionContext &ctx)
void getName(Aurora::NWScript::FunctionContext &ctx)
void pow(Aurora::NWScript::FunctionContext &ctx)
void DEBUG_printToScreen(Aurora::NWScript::FunctionContext &ctx)
void objectToString(Aurora::NWScript::FunctionContext &ctx)
void isHero(Aurora::NWScript::FunctionContext &ctx)
void getVectorNormalize(Aurora::NWScript::FunctionContext &ctx)
static const FunctionSignature kFunctionSignatures[]
The table defining the signature (return type and type of parameters) of each engine function...
Definition: functions.h:70
void printFloat(Aurora::NWScript::FunctionContext &ctx)
void isVectorEmpty(Aurora::NWScript::FunctionContext &ctx)
void getNearestObject(Aurora::NWScript::FunctionContext &ctx)
void printObject(Aurora::NWScript::FunctionContext &ctx)
void getArea(Aurora::NWScript::FunctionContext &ctx)
void jumpTo(DragonAge::Object *object, float x, float y, float z)
Definition: functions.cpp:112
void getCurrentScriptName(Aurora::NWScript::FunctionContext &ctx)
void stringLeft(Aurora::NWScript::FunctionContext &ctx)
void getLocalLocation(Aurora::NWScript::FunctionContext &ctx)
NWScript types.
void insertString(Aurora::NWScript::FunctionContext &ctx)
void printToLogAndFlush(Aurora::NWScript::FunctionContext &ctx)
void vector(Aurora::NWScript::FunctionContext &ctx)
void getNearestObjectByTag(Aurora::NWScript::FunctionContext &ctx)
void getVectorMagnitude(Aurora::NWScript::FunctionContext &ctx)
static const FunctionDefaults kFunctionDefaults[]
The table defining the default values for the parameters of each engine function. ...
Definition: functions.h:71
void getLocalEvent(Aurora::NWScript::FunctionContext &ctx)
void stringToVector(Aurora::NWScript::FunctionContext &ctx)
void setEventCreator(Aurora::NWScript::FunctionContext &ctx)
void setLocalInt(Aurora::NWScript::FunctionContext &ctx)
void getResRef(Aurora::NWScript::FunctionContext &ctx)
void printWarning(Aurora::NWScript::FunctionContext &ctx)
void setLocalEvent(Aurora::NWScript::FunctionContext &ctx)
void printToLogWindow(Aurora::NWScript::FunctionContext &ctx)