Air-Trap
1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
InputComponent.hpp
Go to the documentation of this file.
1
8
#ifndef RTYPE_ECS_COMPONENTS_SERVER_INPUTCOMPONENT_HPP_
9
#define RTYPE_ECS_COMPONENTS_SERVER_INPUTCOMPONENT_HPP_
10
11
#include <cstdint>
12
17
namespace
rtp::ecs::components::server
18
{
27
struct
InputComponent
{
28
enum
InputBits
: uint8_t {
29
MoveUp
= 1 << 0,
30
MoveDown
= 1 << 1,
31
MoveLeft
= 1 << 2,
32
MoveRight
= 1 << 3,
33
Shoot
= 1 << 4,
34
Reload
= 1 << 5,
35
DebugPowerup
= 1 << 6
// Press P to spawn a random powerup (debug only)
36
};
37
uint8_t
mask
= 0;
38
uint8_t
lastMask
= 0;
39
uint32_t
lastProcessedTick
= 0;
40
float
chargeTime
= 0.0f;
41
};
42
}
// namespace rtp::ecs::components::server
43
44
#endif
/* !RTYPE_ECS_COMPONENTS_SERVER_INPUTCOMPONENT_HPP_ */
rtp::ecs::components::server
File : InputComponent.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
rtp::ecs::components::server::InputComponent
Component to handle network input for server entities.
Definition
InputComponent.hpp:27
rtp::ecs::components::server::InputComponent::mask
uint8_t mask
Input mask for filtering input types.
Definition
InputComponent.hpp:37
rtp::ecs::components::server::InputComponent::InputBits
InputBits
Definition
InputComponent.hpp:28
rtp::ecs::components::server::InputComponent::Shoot
@ Shoot
Definition
InputComponent.hpp:33
rtp::ecs::components::server::InputComponent::DebugPowerup
@ DebugPowerup
Definition
InputComponent.hpp:35
rtp::ecs::components::server::InputComponent::MoveLeft
@ MoveLeft
Definition
InputComponent.hpp:31
rtp::ecs::components::server::InputComponent::MoveUp
@ MoveUp
Definition
InputComponent.hpp:29
rtp::ecs::components::server::InputComponent::MoveDown
@ MoveDown
Definition
InputComponent.hpp:30
rtp::ecs::components::server::InputComponent::Reload
@ Reload
Definition
InputComponent.hpp:34
rtp::ecs::components::server::InputComponent::MoveRight
@ MoveRight
Definition
InputComponent.hpp:32
rtp::ecs::components::server::InputComponent::chargeTime
float chargeTime
Accumulated charge time for shoot.
Definition
InputComponent.hpp:40
rtp::ecs::components::server::InputComponent::lastMask
uint8_t lastMask
Previous input mask for edge detection.
Definition
InputComponent.hpp:38
rtp::ecs::components::server::InputComponent::lastProcessedTick
uint32_t lastProcessedTick
Last processed server tick for input.
Definition
InputComponent.hpp:39
common
include
RType
ECS
Components
InputComponent.hpp
Generated by
1.9.8