-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSMState.h
20 lines (20 loc) · 882 Bytes
/
FSMState.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
class FSMState {
public:
enum State : byte {
UNKNOWN = 0, PERFECT = 1, GOOD = 2, BAD = 3, ALERT = 4
};
FSMState() : FSMState(FSMState::UNKNOWN) {}
constexpr FSMState(State pState) : _State(pState) { }
private:
State _State;
public:
constexpr bool operator==(FSMState a) const { return _State == a._State; }
constexpr bool operator!=(FSMState a) const { return _State != a._State; }
constexpr bool operator>(FSMState a) const { return (byte)_State > (byte)a._State; }
constexpr bool operator<(FSMState a) const { return (byte)_State < (byte)a._State; }
constexpr bool operator>=(FSMState a) const { return (byte)_State >= (byte)a._State; }
constexpr bool operator<=(FSMState a) const { return (byte)_State <= (byte)a._State; }
FSMState& operator=(const FSMState& a) { _State = a._State; return(*this); }
operator byte() const { return((byte)_State); }
};