1 #ifndef INPUTSTATEMACHINE_GAME_H
2 #define INPUTSTATEMACHINE_GAME_H
28 std::function<bool()> rawState;
32 :
s(STILL_NOT_PRESSED),
f(NOT_PRESSED),
33 cooldown(30), cooldownCounter(0),
34 rawState(rawStateFunc) {
39 bool currentState = rawState();
59 case JUST_NOT_PRESSED:
64 s = STILL_NOT_PRESSED;
67 case STILL_NOT_PRESSED:
72 s = STILL_NOT_PRESSED;
82 cooldownCounter = cooldown;
91 if (cooldownCounter == 0)
111 return s == JUST_PRESSED;
114 return s == STILL_PRESSED;
117 return s == JUST_NOT_PRESSED;
120 return s == STILL_NOT_PRESSED;
125 throw "cooldown must be positive";
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4