-
Notifications
You must be signed in to change notification settings - Fork 0
/
Button.h
137 lines (120 loc) · 2.61 KB
/
Button.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#pragma once
#include <math.h>
#include "Waves.h"
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
class Waves;
class Button
{
public:
Button();
void LoadFont(ALLEGRO_FONT **font18);
void virtual ResetButton() {pressed = false; activated = false;}
//void virtual DrawButton();
//void virtual PressButton();
//bool virtual WithinButton(float xMouse, float yMouse);
ALLEGRO_FONT *font18;
bool loadedFont;
bool pressed;
bool activated;
int redValue;
int greenValue;
int blueValue;
};
class TowerButton: public Button
{
protected:
int xCenter;
int yCenter;
int radius;
public:
TowerButton();
int GetXCenter() {return xCenter;}
int GetYCenter() {return yCenter;}
int GetRadius() {return radius;}
void DrawButton();
void DrawButtonBorder();
void ResetButton();
void PressButton(bool leftClickUp);
bool WithinButton(float xMouse, float yMouse);
bool GetActivated() {return activated;}
bool GetPressed() {return pressed;}
};
class RedTowerButton: public TowerButton
{
public:
RedTowerButton();
};
class GreenTowerButton: public TowerButton
{
public:
GreenTowerButton();
};
class BlueTowerButton: public TowerButton
{
public:
BlueTowerButton();
};
class StartPauseButton: public Button
{
private:
int xTop, yTop;
int xBot, yBot;
public:
StartPauseButton();
void Destroy();
void DrawButton();
void PressButton(bool leftClickUp);
void ResetButton() {;}
bool WithinButton(float xMouse, float yMouse);
bool GetPaused();
};
class NextWaveButton: public Button
{
private:
int xTop, yTop;
int xBot, yBot;
public:
NextWaveButton();
void PressButton(bool leftClickUp, Waves &waves);
void DrawButton();
bool WithinButton(float xMouse, float yMouse);
};
class UpgradeButton: public Button
{
protected:
int xCenter;
int yCenter;
int radius;
bool live;
public:
UpgradeButton();
void DrawButton();
bool WithinButton(float xMouse, float yMouse);
bool GetLive() {return live;}
void ResetButton() {pressed = false;}
void SetLive(bool live) {UpgradeButton::live = live;}
void SetActive(bool activated) {UpgradeButton::activated = activated;}
void SetXCenter(int x) {xCenter = x;}
void SetYCenter(int y) {yCenter = y;}
int GetRadius() {return radius;}
};
class UpgradeRedButton: public UpgradeButton
{
public:
UpgradeRedButton();
void PressButton(MapElement *grid, bool leftClickUp);
};
class UpgradeGreenButton: public UpgradeButton
{
public:
UpgradeGreenButton();
void PressButton(MapElement *grid, bool leftClickUp);
};
class UpgradeBlueButton: public UpgradeButton
{
public:
UpgradeBlueButton();
void PressButton(MapElement *grid, bool leftClickUp);
};