Skip to content

Commit

Permalink
feat: add event management for version 1 of the protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterLaplace committed Nov 17, 2024
1 parent 67349e3 commit 8885243
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions Flakkari/Protocol/Events.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,49 @@ enum class EventState : uint8_t {
LPL_PACKED_START

struct Event {
EventId id;
EventState state;
V_0::EventId id;
V_0::EventState state;
};

LPL_PACKED_END

} /* namespace V_0 */

namespace V_1 {

enum class EventId : uint8_t {
MOVE_LEFT = 10,
MOVE_RIGHT = 11,
MOVE_UP = 12,
MOVE_DOWN = 13,
MOVE_FRONT = 14,
MOVE_BACK = 15,
LOOK_LEFT = 16,
LOOK_RIGHT = 17,
LOOK_UP = 18,
LOOK_DOWN = 19,
SHOOT = 20,
MAX_EVENT
};

enum class EventState : uint8_t {
NONE = 0,
PRESSED = 1,
RELEASED = 2,
MAX_STATE
};

LPL_PACKED_START

struct Event {
V_1::EventId id;
V_1::EventState state;
};

LPL_PACKED_END

} /* namespace V_1 */

} // namespace Flakkari::Protocol

#endif /* !EVENTS_HPP_ */

0 comments on commit 8885243

Please sign in to comment.