-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathworker.h
49 lines (43 loc) · 932 Bytes
/
worker.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
#ifndef WORKER_H
#define WORKER_H
#include <QObject>
#include <QGraphicsPixmapItem>
#include "graph.h"
class WorkersClan;
class Fence;
class Worker : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
private:
int imgLen;
int healAbility;
QTimer* moveTimer;
QTimer* healTimer;
QTimer* returnTimer;
QTimer* healAnimationTimer;
QStringList healImgs;
QStringList dieImgs;
WorkersClan* group;
int clanIndex;
bool finished;
std::vector<Node*> path;
int curr;
int offsetX;
int offsetY;
double STEP_SIZE;
public:
Worker(WorkersClan*,int);
int getHealAbility();
void setHealAbility(int);
WorkersClan* getGroup();
QTimer* getHealAnimationTimer();
int getClanIndex();
void healFence(Fence*);
void die();
bool isFinished();
void changePath(int,int);
public slots:
void move();
void returnBack();
};
#endif // WORKER_H