-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheinvasionhandler.h
executable file
·56 lines (43 loc) · 1.3 KB
/
einvasionhandler.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
#ifndef EINVASIONHANDLER_H
#define EINVASIONHANDLER_H
#include <vector>
#include "pointers/estdselfref.h"
#include "pointers/estdpointer.h"
class eGameBoard;
class eInvasionEvent;
class eTile;
class eReadStream;
class eWriteStream;
class eWorldCity;
class eSoldierBanner;
enum class eInvasionStage {
spread, wait, invade, comeback
};
class eInvasionHandler {
public:
eInvasionHandler(eGameBoard& board,
const stdsptr<eWorldCity>& city,
eInvasionEvent* const event);
~eInvasionHandler();
void initialize(eTile* const tile,
const int infantry,
const int cavalry,
const int archers);
void incTime(const int by);
void read(eReadStream& src);
void write(eWriteStream& dst) const;
void killAllWithCorpse();
eInvasionStage stage() const { return mStage; }
eTile* tile() const { return mTile; }
bool nearestSoldier(const int fromX, const int fromY,
int& toX,int& toY) const;
private:
eGameBoard& mBoard;
stdsptr<eWorldCity> mCity;
stdptr<eInvasionEvent> mEvent;
eTile* mTile = nullptr;
eInvasionStage mStage = eInvasionStage::spread;
std::vector<stdsptr<eSoldierBanner>> mBanners;
int mWait = 0;
};
#endif // EINVASIONHANDLER_H