Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
InputSystem.hpp
Go to the documentation of this file.
1
8#ifndef INPUT_SYSTEM_HPP
9#define INPUT_SYSTEM_HPP
10
11#include "RType/ECS/ISystem.hpp"
13#include "Core/Settings.hpp"
16#include <SFML/Graphics/RenderWindow.hpp>
17
18#include <SFML/Window/Keyboard.hpp>
19#include <cstdint>
20
21namespace rtp::client {
22
24{
25 public:
33 explicit InputSystem(ecs::Registry& r,
34 ecs::Registry& uiRegistry,
35 Settings& settings,
37 sf::RenderWindow& window);
38
43 void update(float) override;
44
45 private:
46 void playShotSound();
47 enum InputBits : uint8_t {
48 MoveUp = 1 << 0,
49 MoveDown = 1 << 1,
50 MoveLeft = 1 << 2,
51 MoveRight = 1 << 3,
52 Shoot = 1 << 4,
53 Reload = 1 << 5,
54 DebugPowerup = 1 << 6
55 };
56
61 sf::RenderWindow& _window;
63 uint8_t _lastMask = 0;
64 };
65
66} // namespace rtp::client
67
68#endif
Interface for ECS systems.
Network packet implementation for R-Type protocol.
uint8_t _lastMask
Last sent input mask.
void update(float) override
Update input system logic for one frame.
ecs::Registry & _uiRegistry
Reference to the UI registry.
ClientNetwork & _net
Reference to the client network manager.
ecs::Registry & _r
Reference to the entity registry.
Settings & _settings
Reference to the client settings.
sf::RenderWindow & _window
Reference to the SFML render window.
@ MoveUp
Bitmask for input directions.
@ DebugPowerup
Debug key to spawn powerup.
Manages game settings and preferences.
Definition Settings.hpp:67
Abstract base class for all ECS systems.
Definition ISystem.hpp:57
File : Network.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue.hajjar-llauquen@epit...
R-Type client namespace.