-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentity.h
84 lines (74 loc) · 1.98 KB
/
entity.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#pragma once
#include"basic.hpp"
class EntityUnit;
class Entity {
public:
Entity();
virtual bool sound(EntityUnit selff);
virtual IMAGE *render(EntityUnit selff);
virtual bool attack(Pool<EntityUnit> *a, Table b, EntityUnit selff);
virtual bool skill(Pool<EntityUnit> *a, Table b, EntityUnit selff);
virtual bool motion(Pool<EntityUnit> *a, Table b, EntityUnit selff);
virtual void initEntityUnit(EntityUnit& a);
Entities getType()const;
short getHealth()const;
long getAttackInterval()const;
long getSkillInterval()const;
protected:
Entities type;
short maxHealth;
DWORD attackInterval;
DWORD skillInterval;
ResourceManager res;
};
class EntityUnit {
public:
//EntityUnit(Entity* refe);
//void refresh();
void setRefer(Entity* refe);
unsigned short getCurrentHealth()const;
short getVal(byte index)const;
byte getAnimeType()const;
DWORD getLastatk()const;
DWORD getLastSkl()const;
void getPoi(byte* qposition,byte* qpoiInRow,byte* qrow);
CycleLinkedList<IMAGE>::iterator getIterator();
void changeCurHealth(short va);
void setVal(byte index, int va);
void setLastAck(DWORD ti);
void setLastSkl(DWORD ti);
void setAnimeType(byte val);
Entity* getEntityRefer();
void setAnimeIterator(CycleLinkedList<IMAGE>::iterator a);
void setPoi(byte* qposition, byte* qpoiInRow, byte* qrow);
bool changePoi(byte* qposition, byte* qpoiInRow, byte* qrow);
private:
unsigned short currentHealth;
short val[3];
DWORD lastAttack;
DWORD lastSkill;
Entity* refer;
byte animeFrame;
byte animeType;
byte row;
byte poiInRow;
byte position;
CycleLinkedList<IMAGE>::iterator currentAnimeIr;
};
class Pee:public Entity {
public:
Pee();
bool attack(Pool<EntityUnit> *a, Table b);
};
class SunPower :public Entity {
SunPower();
bool skill(short *a);
bool motion(Pool<EntityUnit> *a, Table b, EntityUnit selff);
void initEntityUnit(EntityUnit& a);
};
class Sunflower :public Entity {
public:
static const short cost = 50;
Sunflower();
bool skill(Pool<EntityUnit> *a,Table b,EntityUnit selff);
};