-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tool.h
41 lines (34 loc) · 1021 Bytes
/
Tool.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
#ifndef TOOL_H_INCLUDED
#define TOOL_H_INCLUDED
#include <stdio.h>
#include <vector>
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_audio.h>
#include <allegro5/allegro_acodec.h>
#include "Object.h"
#include "global.h"
class Tool : public Object
{
public:
Tool(int, int);
virtual ~Tool();
// override virtual function "Object::Draw"
void Draw();
void ToggleClicked() { isClicked = !isClicked; }
virtual std::vector<int> Utilize(int x, int y, double){ return {0};}
virtual int getWidth() { return 40; }
virtual int getHeight() { return 40; }
// show selected tower image on cursor position
static void SelectedTool(int, int, int);
protected:
int type;
bool isClicked = false;
ALLEGRO_BITMAP *img;
ALLEGRO_SAMPLE *sample = NULL;
ALLEGRO_SAMPLE_INSTANCE *toolSound = NULL;
};
#endif // TOOL_H_INCLUDED