Crossfire Server, Trunk
CREWrapperObject.h
Go to the documentation of this file.
1 #ifndef CRE_WRAPPER_OBJECT_h
2 #define CRE_WRAPPER_OBJECT_h
3 
4 extern "C" {
5 #include "global.h"
6 }
7 
8 #include <QObject>
9 #include "CREWrapperArchetype.h"
10 #include "CREWrapperTreasure.h"
11 
12 class CREWrapperObject : public QObject
13 {
14  Q_OBJECT
15 
16  Q_PROPERTY(QString name READ name)
17  Q_PROPERTY(QString race READ race)
18  Q_PROPERTY(QString title READ title)
19  Q_PROPERTY(QString slaying READ slaying)
20  Q_PROPERTY(QString skill READ skill)
21  Q_PROPERTY(int type READ type)
22  Q_PROPERTY(int subType READ subType)
23  Q_PROPERTY(int level READ level WRITE setLevel)
24  Q_PROPERTY(bool isMonster READ isMonster)
25  Q_PROPERTY(bool isAlive READ isAlive)
26  Q_PROPERTY(bool isGenerator READ isGenerator)
27  Q_PROPERTY(qint64 experience READ experience WRITE setExperience)
28  Q_PROPERTY(quint32 attacktype READ attacktype)
29  Q_PROPERTY(int ac READ ac WRITE setAc)
30  Q_PROPERTY(int wc READ wc WRITE setWc)
31  Q_PROPERTY(QObject* arch READ arch)
32  Q_PROPERTY(int damage READ damage WRITE setDamage)
33  Q_PROPERTY(int hp READ hp WRITE setHp)
34  Q_PROPERTY(int weight READ weight WRITE setWeight)
35  Q_PROPERTY(QString materialName READ materialName)
36  Q_PROPERTY(QObject* randomItems READ randomItems)
37  Q_PROPERTY(float speed READ speed WRITE setSpeed);
38 
39  public:
41  virtual ~CREWrapperObject();
42 
43  void setObject(object* obj);
44  object *getObject() { return myObject; }
45 
47  QString name() const;
48  QString race() const;
49  QString title() const { return myObject->title; }
50  QString slaying() const { return myObject->slaying; }
51  QString skill() const { return myObject->skill; }
52  int type() const;
53  int subType() const { return myObject->subtype; }
54  int level() const;
55  void setLevel(int level) { myObject->level = level; }
56  bool isMonster() const;
57  bool isAlive() const;
58  bool isGenerator() const { return QUERY_FLAG(myObject, FLAG_GENERATOR); }
59  int64_t experience() const { return myObject->stats.exp; }
61  quint32 attacktype() const;
62  int8_t ac() const { return myObject->stats.ac; }
63  void setAc(int8_t ac) { myObject->stats.ac = ac; }
64  int8_t wc() const { return myObject->stats.wc; }
65  void setWc(int8_t wc) { myObject->stats.wc = wc; }
66  int16_t damage() const { return myObject->stats.dam; }
67  void setDamage(int16_t damage) { myObject->stats.dam = damage; }
68  int16_t hp() const { return myObject->stats.hp; }
69  void setHp(int16_t hp) { myObject->stats.hp = hp; }
70  int32_t weight() const { return myObject->weight; }
71  void setWeight(int32_t weight) { myObject->weight = weight; }
72  QString materialName() const;
74  float speed() const { return myObject->speed; }
75  void setSpeed(float speed) { myObject->speed = speed; }
76 
77  protected:
78  object* myObject;
81 };
82 
83 #endif // CRE_WRAPPER_OBJECT_h
CREWrapperObject::speed
float speed
Definition: CREWrapperObject.h:37
CREWrapperObject::myArchetype
CREWrapperArchetype * myArchetype
Definition: CREWrapperObject.h:79
CREWrapperObject::weight
int32_t weight() const
Definition: CREWrapperObject.h:70
global.h
CREWrapperObject::name
QString name
Definition: CREWrapperObject.h:16
liv::dam
int16_t dam
Definition: living.h:46
CREWrapperObject::materialName
QString materialName
Definition: CREWrapperObject.h:35
CREWrapperObject::subType
int subType
Definition: CREWrapperObject.h:22
FLAG_GENERATOR
#define FLAG_GENERATOR
Definition: define.h:248
QUERY_FLAG
#define QUERY_FLAG(xyz, p)
Definition: define.h:226
CREWrapperObject::isMonster
bool isMonster
Definition: CREWrapperObject.h:24
CREWrapperObject::skill
QString skill
Definition: CREWrapperObject.h:20
liv::wc
int8_t wc
Definition: living.h:37
CREWrapperObject::speed
float speed() const
Definition: CREWrapperObject.h:74
CREWrapperObject::setWc
void setWc(int8_t wc)
Definition: CREWrapperObject.h:65
CREWrapperObject::setAc
void setAc(int8_t ac)
Definition: CREWrapperObject.h:63
CREWrapperObject::setObject
void setObject(object *obj)
Definition: CREWrapperObject.cpp:16
CREWrapperObject::type
int type
Definition: CREWrapperObject.h:21
liv::hp
int16_t hp
Definition: living.h:40
CREWrapperObject::subType
int subType() const
Definition: CREWrapperObject.h:53
CREWrapperObject
Definition: CREWrapperObject.h:12
CREWrapperObject::isGenerator
bool isGenerator() const
Definition: CREWrapperObject.h:58
CREWrapperObject::isGenerator
bool isGenerator
Definition: CREWrapperObject.h:26
CREWrapperObject::isAlive
bool isAlive
Definition: CREWrapperObject.h:25
CREWrapperObject::setHp
void setHp(int16_t hp)
Definition: CREWrapperObject.h:69
CREWrapperObject::randomItems
QObject randomItems
Definition: CREWrapperObject.h:36
CREWrapperObject::myTreasure
CREWrapperTreasureList * myTreasure
Definition: CREWrapperObject.h:80
obj
Definition: object.h:275
obj::slaying
sstring slaying
Definition: object.h:320
CREWrapperObject::title
QString title() const
Definition: CREWrapperObject.h:49
CREWrapperObject::race
QString race
Definition: CREWrapperObject.h:17
liv::exp
int64_t exp
Definition: living.h:47
titlestruct
Definition: readable.c:107
CREWrapperObject::myObject
object * myObject
Definition: CREWrapperObject.h:78
CREWrapperObject::weight
int weight
Definition: CREWrapperObject.h:34
CREWrapperObject::getObject
object * getObject()
Definition: CREWrapperObject.h:44
CREWrapperObject::experience
qint64 experience
Definition: CREWrapperObject.h:27
CREWrapperObject::level
int level
Definition: CREWrapperObject.h:23
obj::speed
float speed
Definition: object.h:330
CREWrapperTreasure.h
CREWrapperObject::setExperience
void setExperience(int64_t experience)
Definition: CREWrapperObject.h:60
CREWrapperObject::hp
int16_t hp() const
Definition: CREWrapperObject.h:68
obj::title
sstring title
Definition: object.h:318
CREWrapperObject::setLevel
void setLevel(int level)
Definition: CREWrapperObject.h:55
obj::stats
living stats
Definition: object.h:371
CREWrapperObject::setDamage
void setDamage(int16_t damage)
Definition: CREWrapperObject.h:67
CREWrapperObject::ac
int ac
Definition: CREWrapperObject.h:29
CREWrapperObject::experience
int64_t experience() const
Definition: CREWrapperObject.h:59
obj::weight
int32_t weight
Definition: object.h:368
CREWrapperObject::skill
QString skill() const
Definition: CREWrapperObject.h:51
CREWrapperObject::wc
int wc
Definition: CREWrapperObject.h:30
obj::subtype
uint8_t subtype
Definition: object.h:342
CREWrapperObject::slaying
QString slaying
Definition: CREWrapperObject.h:19
liv::ac
int8_t ac
Definition: living.h:38
obj::skill
sstring skill
Definition: object.h:322
CREWrapperObject::setSpeed
void setSpeed(float speed)
Definition: CREWrapperObject.h:75
CREWrapperArchetype.h
CREWrapperObject::setWeight
void setWeight(int32_t weight)
Definition: CREWrapperObject.h:71
CREWrapperObject::damage
int damage
Definition: CREWrapperObject.h:32
CREWrapperObject::attacktype
quint32 attacktype
Definition: CREWrapperObject.h:28
CREWrapperArchetype
Definition: CREWrapperArchetype.h:13
CREWrapperObject::hp
int hp
Definition: CREWrapperObject.h:33
CREWrapperObject::ac
int8_t ac() const
Definition: CREWrapperObject.h:62
CREWrapperObject::slaying
QString slaying() const
Definition: CREWrapperObject.h:50
CREWrapperObject::arch
QObject arch
Definition: CREWrapperObject.h:31
obj::level
int16_t level
Definition: object.h:354
CREWrapperObject::damage
int16_t damage() const
Definition: CREWrapperObject.h:66
CREWrapperObject::wc
int8_t wc() const
Definition: CREWrapperObject.h:64
level
Definition: level.py:1
CREWrapperTreasureList
Definition: CREWrapperTreasure.h:11