17#include <unordered_set>
18#include "../common/Logger/Logger.hpp"
21#include "Core/EventBus/EventBus.hpp"
22#include "Events/NetworkEvent/NetworkEvent.hpp"
190 void update(
float deltaTime);
Type-safe event publication/subscription system.
Main game loop orchestrating all subsystems.
std::unique_ptr< Rendering > _rendering
void processInput()
Process player inputs.
static constexpr size_t INPUT_HISTORY_SIZE
void handleEntityDestroyed(const std::vector< uint8_t > &payload)
void handleLeftRoom(const std::vector< uint8_t > &payload)
void handleNetworkMessage(const NetworkEvent &event)
Handle incoming network messages.
void handleGameruleUpdate(const std::vector< uint8_t > &payload)
bool _clientSidePredictionEnabled
uint32_t _inputSequenceId
std::unique_ptr< InputBuffer > _inputBuffer
float _gameSpeedMultiplier
void update(float deltaTime)
Update game logic (variable timestep)
void handleGameState(const std::vector< uint8_t > &payload)
void handleGameOver(const std::vector< uint8_t > &payload)
std::deque< RType::Messages::C2S::PlayerInput::InputSnapshot > _inputHistory
void run()
Start the main game loop.
void setReconciliationThreshold(float threshold)
Set the reconciliation threshold for client-side prediction.
void handleRoomState(const std::vector< uint8_t > &payload)
float getReconciliationThreshold() const
Get the current reconciliation threshold.
void simulateInputHistory(float &x, float &y)
void handleRoomList(const std::vector< uint8_t > &payload)
void processServerReconciliation(const RType::Messages::S2C::EntityState &entity)
bool initialize()
Initialize all game subsystems.
void shutdown()
Stop and clean up all subsystems.
void handleGameStart(const std::vector< uint8_t > &payload)
void handleUIEvent(const UIEvent &event)
void render()
Perform rendering of current frame.
std::optional< uint32_t > _myEntityId
std::unordered_set< uint32_t > _knownEntityIds
float calculateDeltaTime()
Calculate time elapsed since last frame.
void stop()
Stop the game loop.
void fixedUpdate(float fixedDeltaTime)
Update physics simulation (fixed timestep)
void handleChatMessage(const std::vector< uint8_t > &payload)
Event representing a network message.
State of a single entity.
Client-server network replication manager with dedicated network thread.