-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.h
65 lines (48 loc) · 1.63 KB
/
bot.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
#ifndef BOT_H
#define BOT_H
#include <QRandomGenerator>
#include "hero.h"
#include "gridelement.h"
#include "bfs_algorithm.h"
class Bot : public Hero
{
public:
Bot(MapWidget * mapWidget);
virtual ~Bot() {}
protected slots:
virtual void nextMove();
private slots:
virtual void updateLineHeroMouse(QPoint mousePoint = QPoint());
private:
QPoint destinationPoint;
BFS_Algorithm bfs_Algorithm;
ItemsOnScene * corner1 = nullptr;
ItemsOnScene * corner2 = nullptr;
Hero * targetAttack = nullptr;
QVector<GridElement *> path;
int viewRange = 300;
unsigned int numberOfAvailableDirections = 0;
bool goingOpenChest = false;
bool pathFromAlgorithm = false;
bool STATE_ATTACK = false;
bool STATE_HIDE = false;
void checkNearestArea();
void dependingOnReloadingSetState();
bool checkIfItemsBetweenBotAndTarget();
void move();
void checkIfBotIsCloseToDestinationPoint();
void botIsCloseToDestinationPoint();
void randomNewDestinationPoint();
void randNewDestPointUntilItMeetsRequirements();
void newDestinationPointBasingOnHideState();
void newDestinationPointBasingOnTargetPos();
void newDestinationPoint(int x1, int y1, int x2, int y2);
void setDirectionBasingOnAlgorithmAndCorners(bool * direction, int addToX_corner1, int addToY_corner1,
int addToX_corner2, int addToY_corner2);
bool checkIfCornersAvailable(int addToX_corner1, int addToY_corner1, int addToX_corner2, int addToY_corner2);
void findPath();
void resetDirections();
void attack();
virtual void death();
};
#endif // BOT_H