124 void sendInputToServer(
bool up,
bool down,
bool left,
bool right,
bool shoot)
const;
Thread-safe event bus implementation for inter-component communication.
This file contains the IRenderer class declaration.
This file contains the interface for systems.
This file contains the Registry class declaration.
Abstract class for system.
Class for managing entities and their components.
Manages local player input and network communication for multiplayer.
uint32_t m_nextSeqId
Next sequence ID for input packets.
uint32_t m_componentId
Event bus component ID.
PlayerControllerMulti(const PlayerControllerMulti &)=delete
Deleted copy constructor (non-copyable)
~PlayerControllerMulti() override=default
Destructor.
std::unordered_map< eng::Key, bool > m_keysPressed
Current state of all keys.
bool isSpacePressed() const
Check if space bar is currently pressed.
PlayerControllerMulti & operator=(PlayerControllerMulti &&)=delete
Deleted move assignment operator (non-movable)
void sendInputToServer(bool up, bool down, bool left, bool right, bool shoot) const
Send input command to server via event bus.
void sendInputsIfChanged()
Send input update if state has changed.
PlayerControllerMulti & operator=(const PlayerControllerMulti &)=delete
Deleted copy assignment operator (non-copyable)
uint32_t m_lastAckSeqId
Last acknowledged sequence ID from server.
ecs::Entity m_playerEntity
Local player entity ID.
void handleInput(ecs::Registry ®istry, const eng::Event &event)
Handle input events from the window.
const float INPUT_THROTTLE_INTERVAL
Maximum input send rate (144 Hz)
PlayerControllerMulti(PlayerControllerMulti &&)=delete
Deleted move constructor (non-movable)
ecs::Entity createPlayer(ecs::Registry ®istry, float x, float y)
Create the local player entity.
const std::shared_ptr< eng::IRenderer > & m_renderer
Renderer interface reference.
PlayerControllerMulti(const std::shared_ptr< eng::IRenderer > &renderer, uint32_t sessionId)
Constructor.
utl::EventBus & m_eventBus
Event bus reference.
void update(ecs::Registry ®istry, float dt) override
Update the player controller system (called each frame)
Thread-safe event bus for decoupled component communication.
void registerComponent(std::uint32_t componentId, const std::string &name)
Register component name for better debugging.
This file contains common definitions and constants.