-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tower.hpp
74 lines (54 loc) · 1.75 KB
/
Tower.hpp
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
66
67
68
69
70
71
72
73
74
#ifndef TOWER_H
#define TOWER_H
class Tower;
#include <SFML/Graphics.hpp>
#include "Vec.hpp"
enum TowerEvent{
None
};
enum Priority{
Default,
First,
Last,
Near,
Far,
MoreLife,
LessLife,
MoreDamage,
LessDamage,
MoreEnemiesTogether
};
class Tower{
protected:
int _id;
int _ticksForShoot;
int _ticksBetweenShoots;
Vec2i _position;
Priority _priority;
double _minRange,
_maxRange;
public:
Tower();
virtual ~Tower() {};
int getId() const { return _id; }
void setId(int id) { _id = id; }
int getTicksForShoot() const { return _ticksForShoot; }
virtual void setTicksForShoot(int ticksForShoot) { _ticksForShoot = ticksForShoot; }
int getTicksBetweenShoots() const { return _ticksBetweenShoots; }
virtual void setTicksBetweenShoots(int ticksBetweenShoots) { _ticksBetweenShoots = ticksBetweenShoots; }
Vec2i getPosition() const { return _position; }
virtual void setPosition(Vec2i position) { _position = position; }
Priority getPriority() const { return _priority; }
virtual void setPriority(Priority priority){ _priority = priority; }
double getMinRange() const { return _minRange; }
virtual void setMinRange(double minRange){ _minRange = minRange; }
double getMaxRange() const { return _maxRange; }
virtual void setMaxRange(double maxRange){ _maxRange = maxRange; }
virtual TowerEvent tick() = 0;
virtual void draw(sf::RenderWindow* window) const;
virtual void drawOver(sf::RenderWindow* window) const;
virtual void draw(sf::RenderWindow* window, Vec2d point) const {};
virtual void drawOver(sf::RenderWindow* window, Vec2d point) const {};
virtual std::unique_ptr<Tower> clone() const = 0;
};
#endif // TOWER_H