R-Type 0.1
Loading...
Searching...
No Matches
action.hpp
1#pragma once
2
3#include <cstdint>
4
5namespace rtype {
14enum class Action : uint32_t {
15 NoneAction = 0,
16 Up = 1 << 0,
17 Down = 1 << 1,
18 Left = 1 << 2,
19 Right = 1 << 3,
20 Shoot = 1 << 4,
21 Confirm = 1 << 5
22};
23
27namespace Input {
39[[nodiscard]]
40constexpr bool hasAction(uint32_t engineMask, Action action) {
41 return (engineMask & static_cast<uint32_t>(action)) != 0;
42}
43
45} // namespace Input
46
48} // namespace rtype
Action
Client actions, one bit of InputState::actionMask each.
Definition action.hpp:14
constexpr bool hasAction(uint32_t engineMask, Action action)
Tells whether an action is active in a mask.
Definition action.hpp:40
@ Down
Move down.
@ Up
Move up.
@ NoneAction
No action.
@ Confirm
Validate a menu.
@ Right
Move right.
@ Left
Move left.