EHS
Loading...
Searching...
No Matches
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{
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
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
State GetState() const
Definition ButtonState.cpp:63
void SetState(State newState)
Definition ButtonState.cpp:58
void SetThreshold(const float newThreshold)
Definition ButtonState.cpp:78
ButtonState()
Definition ButtonState.cpp:5
Button GetButton() const
Definition ButtonState.cpp:53
float GetThreshold() const
Definition ButtonState.cpp:83
bool IsPressed() const
Definition ButtonState.cpp:73
ButtonState & operator=(const ButtonState &bs)
Definition ButtonState.cpp:20
void SetPressed(bool value)
Definition ButtonState.cpp:68
Definition Button.h:9
Definition Anchor.h:6
State
Definition ButtonState.h:9
@ RELEASED
Definition ButtonState.h:11
@ PRESSED
Definition ButtonState.h:12
@ JUST_RELEASED
Definition ButtonState.h:10
@ TOUCHED
Definition ButtonState.h:13