Line data Source code
1 : #pragma once
2 :
3 : #include <cstdint>
4 : #include <string_view>
5 :
6 : namespace jage::engine::input::mouse {
7 : enum class action : std::uint8_t {
8 : release,
9 : press,
10 : };
11 :
12 : [[nodiscard]] constexpr auto
13 9 : serialize(const action input_action) -> std::string_view {
14 9 : switch (input_action) {
15 3 : case action::release:
16 3 : return "release";
17 4 : case action::press:
18 4 : return "press";
19 2 : default:
20 2 : return "unknown enumerator";
21 : }
22 : }
23 : } // namespace jage::engine::input::mouse
|