Crossfire Server, Trunk  R20513
CREWrapperObject.cpp
Go to the documentation of this file.
1 #include "CREWrapperObject.h"
2 
4 {
5  myObject = NULL;
6  myArchetype = NULL;
7 }
8 
9 void CREWrapperObject::setObject(const object* obj)
10 {
11  myObject = obj;
12  if (myArchetype == NULL)
13  myArchetype = new CREWrapperArchetype(this, obj->arch);
14  else
16 }
17 
19 {
20  return myArchetype;
21 }
22 
23 QString CREWrapperObject::name() const
24 {
25  return myObject->name;
26 }
27 
28 QString CREWrapperObject::race() const
29 {
30  return myObject->race;
31 }
32 
33 int CREWrapperObject::type() const
34 {
35  return myObject->type;
36 }
37 
38 int CREWrapperObject::level() const
39 {
40  return myObject->level;
41 }
42 
43 bool CREWrapperObject::isMonster() const
44 {
46 }
47 
48 bool CREWrapperObject::isAlive() const
49 {
51 }
52 
53 qint64 CREWrapperObject::experience() const
54 {
55  return myObject->stats.exp;
56 }
57 
58 quint32 CREWrapperObject::attacktype() const
59 {
60  return myObject->attacktype;
61 }
62 
63 qint8 CREWrapperObject::ac() const
64 {
65  return myObject->stats.ac;
66 }
67 
68 qint8 CREWrapperObject::wc() const
69 {
70  return myObject->stats.wc;
71 }
72 
73 qint16 CREWrapperObject::damage() const
74 {
75  return myObject->stats.dam;
76 }
77 
78 qint16 CREWrapperObject::hp() const
79 {
80  return myObject->stats.hp;
81 }
82 
83 qint32 CREWrapperObject::weight() const
84 {
85  return myObject->weight;
86 }
87 
88 QString CREWrapperObject::materialName() const
89 {
90  return myObject->materialname;
91 }
Main Crossfire structure, one ingame object.
Definition: object.h:274
int8_t ac
Armour Class, how hard to hit, the lower the better.
Definition: living.h:37
const char * race
Human, goblin, dragon, etc.
Definition: object.h:318
CREWrapperArchetype * arch()
qint16 damage() const
int64_t exp
Experience.
Definition: living.h:46
qint8 ac() const
int16_t hp
Hit Points.
Definition: living.h:39
bool isAlive() const
const object * myObject
#define FLAG_ALIVE
Object can fight (or be fought)
Definition: define.h:230
int type() const
const char * materialname
Specific material name.
Definition: object.h:346
int32_t weight
Attributes of the object.
Definition: object.h:365
void setObject(const object *obj)
qint32 weight() const
int16_t dam
How much damage this object does when hitting.
Definition: living.h:45
qint64 experience() const
const char * name
The name of the object, obviously...
Definition: object.h:311
QString name() const
CREWrapperArchetype * myArchetype
#define QUERY_FLAG(xyz, p)
Definition: define.h:225
qint8 wc() const
QString materialName() const
int8_t wc
Weapon Class, how skilled, the lower the better.
Definition: living.h:36
uint32_t attacktype
Bitmask of attacks this object does.
Definition: object.h:342
bool isMonster() const
QString race() const
void setArchetype(const archetype *arch)
living stats
Str, Con, Dex, etc.
Definition: object.h:368
struct archt * arch
Pointer to archetype.
Definition: object.h:412
uint8_t type
PLAYER, BULLET, etc.
Definition: object.h:338
#define FLAG_MONSTER
Will attack players.
Definition: define.h:245
int level() const
int16_t level
Level of creature or object.
Definition: object.h:351
qint16 hp() const
quint32 attacktype() const