14#include <unordered_map>
15#include "../common/Logger/Logger.hpp"
17#include "Core/EventBus/EventBus.hpp"
95 bool Initialize(uint32_t width, uint32_t height,
const std::string &title);
159 bool LoadTexture(
const std::string &textureName,
const std::string &path);
176 void DrawSprite(
const std::string &textureId,
float xPosition,
float yPosition,
float rotation = 0.0,
193 void DrawText(
const std::string &text,
float xPosition,
float yPosition, uint32_t size = 24);
200 [[nodiscard]] uint32_t
GetWidth()
const;
207 [[nodiscard]] uint32_t
GetHeight()
const;
231 const std::string ¤tAnimation,
int srcX,
int srcY,
int srcW,
int srcH);
265 void SetBackground(
const std::string &mainBackground,
const std::string ¶llaxBackground,
266 float scrollSpeed,
float parallaxSpeedFactor);
361 void UpdateWaitingRoom(
const std::vector<Game::PlayerInfo> &players,
const std::string &roomName,
362 bool isHost,
bool isSpectator =
false);
371 void AddChatMessage(uint32_t playerId,
const std::string &playerName,
const std::string &message,
Type-safe event publication/subscription system.
Raylib implementation of the IGraphics interface.
Graphical rendering system using Raylib.
std::string _connectingServerName
std::unique_ptr< EntityRenderer > _entityRenderer
uint32_t GetHeight() const
Get window height.
void UpdateEntity(uint32_t id, RType::Messages::Shared::EntityType type, float x, float y, int health, const std::string ¤tAnimation, int srcX, int srcY, int srcW, int srcH)
Update or create an entity for rendering with animation.
Graphics::RaylibGraphics _graphics
std::string _selectedServerIp
void ClearBackground()
Clear background configuration.
std::unique_ptr< Game::SettingsMenu > _settingsMenu
void RenderHUD()
Render HUD elements (ping, FPS).
void ClearAllEntities()
Clear all entities from the rendering cache.
void MoveEntityLocally(uint32_t entityId, float deltaX, float deltaY)
Move an entity locally (client-side prediction)
void SetMyEntityId(uint32_t id)
Set the local player's entity ID.
void InitializeAccessibilityMenu()
bool GetShowPing() const
Get ping display state.
std::unique_ptr< Game::AccessibilityMenu > _accessibilityMenu
bool IsKeyDown(int key) const
Check if a key is currently being held down.
bool WindowShouldClose() const
void InitializeLoginMenu()
static constexpr float PING_UPDATE_INTERVAL
void InitializeServerListMenu()
void InitializeMenus()
Initialize UI factory, menus and all related callbacks.
void InitializeVictoryMenu()
void SetOnChatMessageSent(std::function< void(const std::string &)> callback)
Set callback for when a chat message is sent.
void UpdateFpsCounter()
Update FPS counter based on delta time.
void UpdateRoomList(const std::vector< RoomData > &rooms)
Update room list from server data.
bool LoadTexture(const std::string &textureName, const std::string &path)
Load a texture from file.
void InitializeCreateRoomMenu()
void RemoveEntity(uint32_t id)
Remove an entity from rendering.
void SetBackground(const std::string &mainBackground, const std::string ¶llaxBackground, float scrollSpeed, float parallaxSpeedFactor)
Set up background layers for parallax scrolling.
std::unique_ptr< Game::RoomListMenu > _roomListMenu
std::string _gameOverReason
void SubscribeToConnectionEvents()
void SetShowPing(bool enabled)
Enable/disable ping display.
std::unique_ptr< UI::RaylibUIFactory > _uiFactory
void DrawText(const std::string &text, float xPosition, float yPosition, uint32_t size=24)
Draw text on screen.
void UpdateInterpolation(float deltaTime)
Update interpolation for all entities.
void InitializeMainMenu()
std::unique_ptr< Game::ConnectionMenu > _connectionMenu
std::unique_ptr< Game::KeyBindingsMenu > _keyBindingsMenu
bool GetShowFps() const
Get FPS display state.
bool IsWindowOpen() const
Check if window is open.
void UpdateChatVisibility()
Update chat widget visibility based on current scene.
void ApplyInitialMenuSettings()
Apply runtime settings affecting rendering (target FPS, HUD visibility...).
bool Initialize(uint32_t width, uint32_t height, const std::string &title)
Initialize the rendering system and create window.
void InitializeConfirmQuitMenu()
void InitializeRoomListMenu()
void RenderGameScene()
Render the game scene (entities).
std::unique_ptr< Game::CreateRoomMenu > _createRoomMenu
std::unique_ptr< Game::AddServerMenu > _addServerMenu
std::unique_ptr< Game::VictoryMenu > _victoryMenu
void SetLocalPlayerMoving(bool moving)
Set whether the local player is currently moving.
void InitializeConnectionMenu()
std::unique_ptr< Game::ConfirmQuitMenu > _confirmQuitMenu
std::unique_ptr< Game::LoginMenu > _loginMenu
std::unique_ptr< Game::DefeatMenu > _defeatMenu
void Render()
Perform rendering of current frame.
void SetReconciliationThreshold(float threshold)
Set the reconciliation threshold for client-side prediction.
void InitializeKeyBindingsMenu()
void Shutdown()
Stop the rendering system and destroy window.
void UpdateUI()
Update all UI elements based on current scene.
void InitializeDefeatMenu()
void AddChatMessage(uint32_t playerId, const std::string &playerName, const std::string &message, uint64_t timestamp)
Add a chat message to the chat widget.
void ShowGameOver(const std::string &reason)
Display the game over screen.
void LoadAccessibilitySettings()
void SetPlayerName(const std::string &name)
Update the displayed player name (e.g., after authentication)
void InitializeSettingsMenu()
void ClearWindow()
Clears the window before rendering its content.
std::unique_ptr< Game::MainMenu > _mainMenu
uint32_t GetWidth() const
Get window width.
std::unique_ptr< Game::WaitingRoomMenu > _waitingRoomMenu
void SetClientSidePredictionEnabled(bool enabled)
Enable or disable client-side prediction for local player.
void UpdatePingTimer(float deltaTime)
Update ping display timer (called every frame)
std::unique_ptr< Game::ChatWidget > _chatWidget
void InitializeChatWidget()
uint16_t _selectedServerPort
void StartGame()
Switch immediately to the game scene.
void HandleEscapeKeyInput()
Handle ESC key input to toggle settings overlay in-game.
void UpdateBackground(float deltaTime)
Update background scroll positions.
void SetPing(uint32_t pingMs)
Set the current ping value for display.
void SaveAccessibilitySettings()
void DrawSprite(const std::string &textureId, float xPosition, float yPosition, float rotation=0.0, float scale=1.0)
Draw a sprite on screen.
void InitializeAddServerMenu()
std::unique_ptr< Audio::SoundEffectManager > _soundEffectManager
void RenderUI()
Render all UI menus based on current scene and overlay state.
bool IsGamepadButtonDown(int gamepad, int button) const
Check if a gamepad button is currently held down.
void InitializeWaitingRoomMenu()
float GetReconciliationThreshold() const
Get the current reconciliation threshold.
std::string _selectedRoomId
bool IsGamepadAvailable(int gamepad) const
Check if a gamepad is available/connected.
std::unique_ptr< Game::ServerListMenu > _serverListMenu
void UpdateWaitingRoom(const std::vector< Game::PlayerInfo > &players, const std::string &roomName, bool isHost, bool isSpectator=false)
Update waiting room with player list.
void SetShowFps(bool enabled)
Enable/disable FPS display.
EntityType
Entity type enum - matches Cap'n Proto enum.