-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobotpath.h
43 lines (35 loc) · 1.03 KB
/
robotpath.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
#ifndef ROBOTPATH_H
#define ROBOTPATH_H
#include "robotgridmatrix.h"
#include <algorithm>
#include <QPoint>
#include "map.h"
typedef struct _Robot {
QPoint Pos; /** Robot position */
int Dir; /** Directions: {up}(1), {down}{-1}, {left}(-2), {right}{2} */
int PrevDir; /** Last taken direction */
int ID; /** Robot identification */
}Robot;
enum States {
UP = 1,
DOWN = -1,
LEFT = -2,
RIGHT = 2,
SHARED = 3,
DEFAULT = 0
};
class RobotPath
{
QList<QPoint> *botOnePath;
QList<QPoint> *botTwoPath;
Map *map;
int Maze[8][10];
public:
RobotPath(RobotGridMatrix *Maze, QList<QPoint> botOnePath, QList<QPoint> botTwoPath); /** Class constructor */
RobotPath(Map maze, QList<QPoint> *botOnePath, QList<QPoint> *botTwoPath);
void Movement(Robot& bot);
~RobotPath(); /** Class destructor */
void FindDirection(Robot& BOT, int Elem); /** Methode to find next step */
void MakeStep(Robot& BOT); /** Method to make a next step */
};
#endif // ROBOTPATH_H