Actions a player holds during the tick, as received from its client.
More...
#include <aegis2d/ecs/components.hpp>
|
| constexpr bool | holds (Action action) const noexcept |
| | Tells whether an action is held.
|
| |
| constexpr void | set (Action action, bool pressed) noexcept |
| | Holds or releases an action.
|
| |
|
| std::uint8_t | held = 0 |
| | Held actions, one Action bit each.
|
| |
Actions a player holds during the tick, as received from its client.
One byte, so it is cheap to send every tick (#125); the client maps its keys and gamepad buttons to these actions, the server only reads them.
◆ holds()
| constexpr bool aegis2d::ecs::PlayerInput::holds |
( |
Action |
action | ) |
const |
|
inlineconstexprnoexcept |
Tells whether an action is held.
- Parameters
-
- Returns
true if its bit is set.
◆ set()
| constexpr void aegis2d::ecs::PlayerInput::set |
( |
Action |
action, |
|
|
bool |
pressed |
|
) |
| |
|
inlineconstexprnoexcept |
Holds or releases an action.
- Parameters
-
| action | Action to change. |
| pressed | true to hold it, false to release it. |
◆ held
| std::uint8_t aegis2d::ecs::PlayerInput::held = 0 |
Held actions, one Action bit each.
The documentation for this struct was generated from the following file: