-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIMovable.h
51 lines (32 loc) · 1.15 KB
/
IMovable.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
#pragma once
#include <cmath>
#include "Labyrinth.h"
#include "Resources.h"
class Entity;
class IMovable {
protected:
float screenX;
float screenY;
float speed;
int tileX;
int tileY;
virtual void move(float x, float y);
virtual void movement() = 0;
virtual bool canMove(Labyrinth &labyrinth) = 0;
virtual void teleportTunnels() = 0;
IMovable(float screenX_, float screenY_, float speed_, int tileX_, int tileY_) :
screenX(screenX_), screenY(screenY_), speed(speed_), tileX(tileX_), tileY(tileY_) {}
public:
[[nodiscard]] int getTileX() const { return tileX; }
[[nodiscard]] int getTileY() const { return tileY; }
virtual bool isScattering() = 0;
virtual bool render(int &delay, const std::vector<std::unique_ptr<Entity>> &entities, sf::RenderWindow *window,
Labyrinth &labyrinth) = 0;
virtual void teleport(int x, int y) = 0;
virtual bool isOutHome() = 0;
virtual void setFrightened(bool f) = 0;
virtual void set_target(int x, int y) = 0;
virtual bool isFrightened() = 0;
virtual void key(int code) = 0;
virtual ~IMovable() = default;
};