-
Notifications
You must be signed in to change notification settings - Fork 0
/
Input.h
45 lines (40 loc) · 1.12 KB
/
Input.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
#ifndef __INPUT_H__
#define __INPUT_H__
#include <utility>
#include "Interaction.h"
#include "allegro5/allegro.h"
class Input : public Interaction
{
public:
static Input *GetInstance();
void ReadInput();
void ReadUpgrade();
int GetMovement() const;
int GetUpgrade() const;
std::pair<int,int> GetWeapons() const;
std::pair <int,int> GetMouse() const;
bool IsClosed() const;
bool IsPressed(int keyCode) const;
bool IsMouseClicked() const;
bool Timer();
static void RemoveInstance();
void ForcePressed(int keyCode);
void ForceClick(bool clicked, int x, int y);
void ForceClose();
private:
static Input *instance;
Input();
~Input();
bool key[ALLEGRO_KEY_MAX];
ALLEGRO_EVENT_QUEUE *event_queue;
ALLEGRO_TIMER *timer;
int movement;
int upgrade;
std::pair<int,int> weapons; // special weapons, direction
std::pair<int,int> mouse;
bool mouseClick;
bool closed;
bool time;
int forced;
};
#endif