Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
rtp::client::InputSystem Class Reference

#include <InputSystem.hpp>

Inheritance diagram for rtp::client::InputSystem:
Collaboration diagram for rtp::client::InputSystem:

Public Member Functions

 InputSystem (ecs::Registry &r, ecs::Registry &uiRegistry, Settings &settings, ClientNetwork &net, sf::RenderWindow &window)
 Constructor for InputSystem.
 
void update (float) override
 Update input system logic for one frame.
 
- Public Member Functions inherited from rtp::ecs::ISystem
virtual ~ISystem () noexcept=default
 

Private Types

enum  InputBits : uint8_t {
  MoveUp = 1 << 0 , MoveDown = 1 << 1 , MoveLeft = 1 << 2 , MoveRight = 1 << 3 ,
  Shoot = 1 << 4 , Reload = 1 << 5 , DebugPowerup = 1 << 6
}
 

Private Member Functions

void playShotSound ()
 

Private Attributes

ecs::Registry_r
 Reference to the entity registry.
 
ecs::Registry_uiRegistry
 Reference to the UI registry.
 
Settings_settings
 Reference to the client settings.
 
ClientNetwork_net
 Reference to the client network manager.
 
sf::RenderWindow & _window
 Reference to the SFML render window.
 
uint8_t _lastMask = 0
 Last sent input mask.
 

Detailed Description

Definition at line 23 of file InputSystem.hpp.

Member Enumeration Documentation

◆ InputBits

enum rtp::client::InputSystem::InputBits : uint8_t
private
Enumerator
MoveUp 

Bitmask for input directions.

MoveDown 
MoveLeft 
MoveRight 
Shoot 
Reload 
DebugPowerup 

Debug key to spawn powerup.

Definition at line 47 of file InputSystem.hpp.

Constructor & Destructor Documentation

◆ InputSystem()

rtp::client::InputSystem::InputSystem ( ecs::Registry r,
ecs::Registry uiRegistry,
Settings settings,
ClientNetwork net,
sf::RenderWindow &  window 
)
explicit

Constructor for InputSystem.

Parameters
rReference to the entity registry
settingsReference to the client settings
netReference to the client network manager
windowReference to the SFML render window

Definition at line 20 of file InputSystem.cpp.

Member Function Documentation

◆ playShotSound()

◆ update()

Member Data Documentation

◆ _lastMask

uint8_t rtp::client::InputSystem::_lastMask = 0
private

Last sent input mask.

Definition at line 63 of file InputSystem.hpp.

Referenced by update().

◆ _net

ClientNetwork& rtp::client::InputSystem::_net
private

Reference to the client network manager.

Definition at line 60 of file InputSystem.hpp.

Referenced by update().

◆ _r

ecs::Registry& rtp::client::InputSystem::_r
private

Reference to the entity registry.

Definition at line 57 of file InputSystem.hpp.

Referenced by playShotSound().

◆ _settings

Settings& rtp::client::InputSystem::_settings
private

Reference to the client settings.

Definition at line 59 of file InputSystem.hpp.

Referenced by playShotSound(), and update().

◆ _uiRegistry

ecs::Registry& rtp::client::InputSystem::_uiRegistry
private

Reference to the UI registry.

Definition at line 58 of file InputSystem.hpp.

Referenced by update().

◆ _window

sf::RenderWindow& rtp::client::InputSystem::_window
private

Reference to the SFML render window.

Definition at line 61 of file InputSystem.hpp.

Referenced by update().


The documentation for this class was generated from the following files: