R-Type
0.1
Loading...
Searching...
No Matches
action.hpp
1
#pragma once
2
3
#include <cstdint>
4
5
namespace
rtype {
14
enum 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
27
namespace
Input {
39
[[nodiscard]]
40
constexpr
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
rtype::Action
Action
Client actions, one bit of InputState::actionMask each.
Definition
action.hpp:14
rtype::Input::hasAction
constexpr bool hasAction(uint32_t engineMask, Action action)
Tells whether an action is active in a mask.
Definition
action.hpp:40
rtype::Action::Down
@ Down
Move down.
rtype::Action::Up
@ Up
Move up.
rtype::Action::NoneAction
@ NoneAction
No action.
rtype::Action::Confirm
@ Confirm
Validate a menu.
rtype::Action::Right
@ Right
Move right.
rtype::Action::Left
@ Left
Move left.
rtype::Action::Shoot
@ Shoot
Shoot.
src
Client
input
action.hpp
Generated by
1.12.0