Crossfire Server, Trunk  R20513
CREScriptEngine.cpp
Go to the documentation of this file.
1 #include "CREScriptEngine.h"
2 
3 extern "C"
4 {
5 #include "global.h"
6 #include "attack.h"
7 }
8 
10 {
11  QScriptValue attacks = newObject();
12 
13  for (int attack = 0; attack < NROFATTACKS; attack++)
14  {
15  QString name(attacktype_desc[attack]);
16  name = name.replace(' ', '_');
17  attacks.setProperty(name, 1 << attack);
18  }
19 
20  globalObject().setProperty("AttackType", attacks, QScriptValue::ReadOnly | QScriptValue::Undeletable);
21 }
22 
24 {
25 }
virtual ~CREScriptEngine()
Global type definitions and header inclusions.
Attack-related definitions.
EXTERN const char *const attacktype_desc[NROFATTACKS]
Definition: attack.h:138
#define NROFATTACKS
Definition: attack.h:17
const char *const attacks[NROFATTACKS]
Attack type names.
Definition: living.c:129