OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Aul.h File Reference
#include "object/C4Id.h"
#include "script/C4StringTable.h"
#include "script/C4Value.h"
#include "script/C4ValueMap.h"
#include "C4AulWarnings.h"
Include dependency graph for C4Aul.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  C4AulError
 
class  C4AulParseError
 
class  C4AulExecError
 
class  C4AulFuncMap
 
class  C4AulUserFile
 
class  C4AulErrorHandler
 
class  C4AulScriptEngine
 

Macros

#define C4AUL_MAX_Identifier   100
 
#define DIAG(id, text, enabled)   id,
 

Enumerations

enum  C4AulWarningId { C4AulWarningId::DIAG, C4AulWarningId::WarningCount }
 

Functions

void InitCoreFunctionMap (C4AulScriptEngine *pEngine)
 

Variables

const char * C4AulWarningIDs []
 
const char * C4AulWarningMessages []
 
C4AulScriptEngine ScriptEngine
 

Macro Definition Documentation

#define C4AUL_MAX_Identifier   100

Definition at line 26 of file C4Aul.h.

Referenced by C4Effect::AssignCallbackFunctions().

#define DIAG (   id,
  text,
  enabled 
)    id,

Definition at line 31 of file C4Aul.h.

Enumeration Type Documentation

enum C4AulWarningId
strong
Enumerator
DIAG 
WarningCount 

Definition at line 29 of file C4Aul.h.

30 {
31 #define DIAG(id, text, enabled) id,
32 #include "C4AulWarnings.h"
33 #undef DIAG
35 };

Function Documentation

void InitCoreFunctionMap ( C4AulScriptEngine pEngine)

Definition at line 1142 of file C4Script.cpp.

References Abs(), AddFunc(), Angle(), C4V_Int, C4VInt(), Cos(), Distance(), F, C4AulExec::FnLogCallStack(), C4AulExec::FnTranslate(), C4AulScriptEngine::GetPropList(), C4ScriptConstDef::Identifier, Inside(), Random(), C4AulScriptEngine::RegisterGlobalConstant(), Sin(), and WildcardMatch().

Referenced by c4_mapgen_handle_init_script_engine(), and C4Game::InitScriptEngine().

1143 {
1144  // add all def constants (all Int)
1145  for (C4ScriptConstDef *pCDef = &C4ScriptConstMap[0]; pCDef->Identifier; pCDef++)
1146  {
1147  assert(pCDef->ValType == C4V_Int); // only int supported currently
1148  pEngine->RegisterGlobalConstant(pCDef->Identifier, C4VInt(pCDef->Data));
1149  }
1150 
1151  C4PropListStatic * p = pEngine->GetPropList();
1152  // add all def script funcs
1153  for (C4ScriptFnDef *pDef = &C4ScriptFnMap[0]; pDef->Identifier; pDef++)
1154  new C4AulDefFunc(p, pDef);
1155 #define F(f) ::AddFunc(p, #f, Fn##f)
1156  F(ParseInt);
1157  F(Abs);
1158  F(Min);
1159  F(Max);
1160  F(Sin);
1161  F(Cos);
1162  F(Sqrt);
1163  F(ArcSin);
1164  F(ArcCos);
1165  F(BoundBy);
1166  F(Inside);
1167  F(Random);
1168 
1169  F(CreateArray);
1170  F(CreatePropList);
1171  F(GetProperties);
1172  F(GetProperty);
1173  F(SetProperty);
1174  F(GetPrototype);
1175  F(SetPrototype);
1176  F(ResetProperty);
1177  F(GetName);
1178  F(AddEffect);
1179  F(CreateEffect);
1180  F(CheckEffect);
1181  F(RemoveEffect);
1182  F(GetEffect);
1183  F(GetEffectCount);
1184  F(RegexReplace);
1185  F(RegexSearch);
1186  F(RegexMatch);
1187  F(RegexSplit);
1188  F(Distance);
1189  F(Angle);
1190  F(GetChar);
1191  F(GetType);
1192  F(ModulateColor);
1193  F(WildcardMatch);
1194  F(GetLength);
1195  F(SetLength);
1196  F(GetIndexOf);
1197  F(DeepEqual);
1198  F(FatalError);
1199  F(StartCallTrace);
1200  F(StartScriptProfiler);
1201  F(StopScriptProfiler);
1202  F(SortArray);
1203  F(SortArrayByProperty);
1204  F(SortArrayByArrayElement);
1205  F(Trans_Identity);
1206  F(Trans_Translate);
1207  F(Trans_Scale);
1208  F(Trans_Rotate);
1209  F(LocateFunc);
1210  F(FileWrite);
1211  F(eval);
1212  F(StringToIdentifier);
1213  F(GetConstantNameByValue);
1214  F(ReplaceString);
1215 
1216  ::AddFunc(p, "Translate", C4AulExec::FnTranslate);
1217  ::AddFunc(p, "LogCallStack", C4AulExec::FnLogCallStack);
1218 #undef F
1219 }
void RegisterGlobalConstant(const char *szName, const C4Value &rValue)
static bool FnLogCallStack(C4PropList *_this)
Definition: C4AulExec.cpp:130
C4ScriptFnDef C4ScriptFnMap[]
Definition: C4Script.cpp:1130
uint32_t Random()
Definition: C4Random.cpp:43
C4PropListStatic * GetPropList()
Definition: C4Aul.h:151
C4Value C4VInt(int32_t i)
Definition: C4Value.h:242
int32_t Distance(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2)
Definition: Standard.cpp:25
C4ScriptConstDef C4ScriptConstMap[]
Definition: C4Script.cpp:1081
const char * Identifier
Definition: C4AulDefFunc.h:276
#define F(f)
static C4String * FnTranslate(C4PropList *_this, C4String *text)
Definition: C4AulExec.cpp:100
int Angle(int iX1, int iY1, int iX2, int iY2)
Definition: Standard.cpp:36
const char * Identifier
Definition: C4AulDefFunc.h:268
bool WildcardMatch(const char *szWildcard, const char *szString)
Definition: StdFile.cpp:374
T Abs(T val)
Definition: Standard.h:42
C4Real Sin(const C4Real &fAngle)
Definition: C4Real.h:265
void AddFunc(C4PropListStatic *Parent, const char *Name, RType(*pFunc)(ThisType *, ParTypes...), bool Public=true)
Definition: C4AulDefFunc.h:260
bool Inside(T ival, U lbound, V rbound)
Definition: Standard.h:43
C4Real Cos(const C4Real &fAngle)
Definition: C4Real.h:266

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char* C4AulWarningIDs[]

Definition at line 34 of file C4Aul.cpp.

const char* C4AulWarningMessages[]

Definition at line 28 of file C4Aul.cpp.

C4AulScriptEngine ScriptEngine