-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobot.h
48 lines (39 loc) · 911 Bytes
/
robot.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
#ifndef ROBOT_H
#define ROBOT_H
#include <QGraphicsPixmapItem>
#include <QObject>
#include <QGraphicsItem>
#include <QMediaPlayer>
class Robot: public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
private:
enum orientation_type
{
north,
south,
east,
west
};
orientation_type currentOrientation = east;
QMediaPlayer *vaccumSound;
QMediaPlayer *robotSound;
public:
Robot(QGraphicsItem *parent = 0);
void setOrientation(orientation_type orientation);
bool forward();
void turnCW();
void turnAntiCW();
bool eastEnd();
bool westEnd();
bool northEnd();
bool southEnd();
bool zig();
bool zag();
void move();
int getRobotX();
int getRobotY();
public slots:
void vacuum();
};
#endif // ROBOT_H