-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharacters.h
62 lines (51 loc) · 1.49 KB
/
characters.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
#ifndef CHARACTERS_H
#define CHARACTERS_H
#include <ConsoleWindow.h>
#include <QElapsedTimer>
/**
* @todo write docs
*/
struct coordinates{
int x;
int y;
coordinates(int x, int y);
};
int rrnd(int min_value, int max_value);
bool operator ==(const coordinates &lhs, const coordinates &rhs);
enum move_direction {
directionUp, directionDown, directionLeft, directionRight, directionNone
};
class Meeple{
public:
coordinates position = coordinates(0,0);
void SetPosition(int x, int y);
move_direction direction;
};
class Pacman : public Meeple{
public:
int points;
Pacman();
void EatPoint();
coordinates Move(const char& pressedKey, const std::vector<move_direction> &possibleDirections);
};
class Ghost : public Meeple{
public:
virtual ~Ghost() = default;
Ghost() = default;
bool isParkedOnDot;
virtual coordinates Move(const std::vector<move_direction> &possibleDirections, Pacman &pacman, const bool &pillActive) = 0;
char symbol;
bool isActive;
};
class StupidGhost : public Ghost{
public:
StupidGhost(int x, int y);
coordinates Move(const std::vector<move_direction> &possibleDirections, Pacman &pacman, const bool &pillActive) override;
};
class NotAsStupidGhost : public Ghost{
int everySecondMove;
public:
NotAsStupidGhost(int x, int y);
coordinates Move(const std::vector<move_direction> &possibleDirections, Pacman &pacman, const bool &pillActive) override;
};
#endif // CHARACTERS_H