This repository has been archived by the owner on Mar 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharacterEvents.h
81 lines (80 loc) · 2.06 KB
/
CharacterEvents.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
#pragma once
#include "Event.h"
class Character;
class Cell;
namespace Events
{
namespace CharacterEvents
{
class CharacterEvent : public Events::Event
{
public:
CharacterEvent(Character* c) : _character(c){}
virtual ~CharacterEvent(){}
Character* getCharacter() const { return _character; }
private:
Character* _character;
};
class MoveEvent : public CharacterEvent
{
public:
MoveEvent(Character* c, Cell* _origin, Cell* dst, bool moveWanted = true) : CharacterEvent(c), destination(dst), origin(_origin), move_wanted(moveWanted){}
virtual ~MoveEvent(){}
Cell* destination;
Cell* origin;
bool move_wanted;
};
class DieEvent : public CharacterEvent
{
public:
DieEvent(Character* c) : CharacterEvent(c) {}
virtual ~DieEvent(){}
};
/* losing and gaining stat trigger these */
class LoseGainStatEvent : public CharacterEvent
{
public:
LoseGainStatEvent(Character* c, int amount) : CharacterEvent(c), _amount(amount) {}
virtual ~LoseGainStatEvent(){}
int getAmount() const { return _amount; }
private:
int _amount;
};
class LoseHpEvent : public LoseGainStatEvent
{
public:
LoseHpEvent(Character* c, int amount) : LoseGainStatEvent(c, amount){}
virtual ~LoseHpEvent(){}
};
class GainHPEvent : public LoseGainStatEvent
{
public:
GainHPEvent(Character* c, int amount) : LoseGainStatEvent(c, amount){}
virtual ~GainHPEvent(){}
};
class LoseMPEvent : public LoseGainStatEvent
{
public:
LoseMPEvent(Character* c, int amount) : LoseGainStatEvent(c, amount) {}
virtual ~LoseMPEvent(){}
};
class GainMPEvent : public LoseGainStatEvent
{
public:
GainMPEvent(Character* c, int amount) : LoseGainStatEvent(c, amount){}
virtual ~GainMPEvent(){}
};
class LoseCPEvent : public LoseGainStatEvent
{
public:
LoseCPEvent(Character* c, int amount) : LoseGainStatEvent(c, amount) {}
virtual ~LoseCPEvent(){}
};
class GainCPEvent : public LoseGainStatEvent
{
public:
GainCPEvent(Character* c, int amount) : LoseGainStatEvent(c, amount){}
virtual ~GainCPEvent(){}
};
}
}