forked from NattyBumppo/Simon-Clone-for-Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInput.h
38 lines (28 loc) · 837 Bytes
/
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
/*
Functions to handle button input on the Arduino.
*/
#ifndef BUTTONINPUT_H
#define BUTTONINPUT_H
#include "gameplay.h"
class SNESpad;
class Input
{
public:
static Input& Get();
void Update();
int Buttons(); // Buttons that are pressed this frame.
int Pressed(); // Buttons that were pressed this frame, but not last
int Released(); // Buttons that were not pressed this frame, but were last
int Held(); // Buttons that were pressed both this and last frame
Difficulty GetDifficulty(); // State of the Difficulty Switch
int SNESCode(Color color); // The Button Flag for the specified color
private:
Input();
Input(const Input& rhs);
Input& operator=(const Input& rhs);
static Input* spInstance;
SNESpad* padInput;
int prevPad;
int curPad;
};
#endif