EHS
ButtonState.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "Button.h"
5
6namespace ehs
7{
8 enum class State
9 {
12 PRESSED,
14 };
15
16 class EHS_LIB_IO ButtonState
17 {
18 private:
19 Button button;
20 State state;
21 bool pressed;
22 float threshold;
23
24 public:
26
27 ButtonState(const Button& button, const State state);
28
29 ButtonState(const ButtonState& bs);
30
31 ButtonState& operator=(const ButtonState& bs);
32
33 bool operator==(const Button& other) const;
34
35 bool operator!=(const Button& other) const;
36
37 bool operator==(const State otherState) const;
38
39 bool operator!=(const State otherState) const;
40
41 Button GetButton() const;
42
43 void SetState(State newState);
44
45 State GetState() const;
46
47 void SetPressed(bool value);
48
49 bool IsPressed() const;
50
51 void SetThreshold(const float newThreshold);
52
53 float GetThreshold() const;
54 };
55}
bool operator!=(const T *const first, const ehs::Str< T, N > &second)
Definition: Str.h:1916
bool operator==(const T *const first, const ehs::Str< T, N > &second)
Definition: Str.h:1906
Definition: ButtonState.h:17
Definition: Button.h:9
Definition: Anchor.h:6
State
Definition: ButtonState.h:9