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::scenes::RoomWaitingScene Class Reference

Scene for waiting in a game room. More...

#include <RoomWaitingScene.hpp>

Inheritance diagram for rtp::client::scenes::RoomWaitingScene:
Collaboration diagram for rtp::client::scenes::RoomWaitingScene:

Public Types

using ChangeStateFn = std::function< void(GameState)>
 Type alias for a function that changes the game state.
 

Public Member Functions

 RoomWaitingScene (ecs::Registry &UiRegistry, Settings &settings, TranslationManager &translationManager, NetworkSyncSystem &network, graphics::UiFactory &uiFactory, std::function< void(GameState)> changeState)
 Constructor for RoomWaitingScene.
 
void onEnter (void) override
 Called when the scene is entered.
 
void onExit (void) override
 Called when the scene is exited.
 
void handleEvent (const sf::Event &event) override
 Handle an incoming event.
 
void update (float dt) override
 Update the scene state.
 
- Public Member Functions inherited from rtp::client::interfaces::IScene
virtual ~IScene (void)=default
 

Private Member Functions

void openChat (void)
 
void closeChat (void)
 
void updateChatHistoryText (void)
 
void sendChatMessage (void)
 

Private Attributes

ecs::Registry_uiRegistry
 Reference to the ECS registry.
 
Settings_settings
 Reference to the application settings.
 
TranslationManager_translationManager
 Reference to the translation manager.
 
NetworkSyncSystem_network
 Reference to the client network.
 
graphics::UiFactory_uiFactory
 UI Factory for creating UI components.
 
ChangeStateFn _changeState
 Function to change the game state.
 
bool _uiReady = false
 Player ready status in the UI.
 
bool _chatOpen = false
 Whether expanded chat is open.
 
ecs::Entity _chatCompactPanel {}
 Compact chat background panel.
 
ecs::Entity _chatCompactText {}
 Text entity for last chat message.
 
ecs::Entity _chatToggleButton {}
 Toggle button for chat.
 
ecs::Entity _chatPanel {}
 Expanded chat panel.
 
ecs::Entity _chatHistoryText {}
 Text entity for chat history.
 
ecs::Entity _chatInput {}
 Text input entity for chat.
 

Detailed Description

Scene for waiting in a game room.

This scene displays the current room status, including the list of players in the room and options to ready up or leave the room.

Definition at line 31 of file RoomWaitingScene.hpp.

Member Typedef Documentation

◆ ChangeStateFn

Type alias for a function that changes the game state.

Definition at line 51 of file RoomWaitingScene.hpp.

Constructor & Destructor Documentation

◆ RoomWaitingScene()

rtp::client::scenes::RoomWaitingScene::RoomWaitingScene ( ecs::Registry UiRegistry,
Settings settings,
TranslationManager translationManager,
NetworkSyncSystem network,
graphics::UiFactory uiFactory,
std::function< void(GameState)>  changeState 
)

Constructor for RoomWaitingScene.

Parameters
registryReference to the ECS registry
settingsReference to the application settings
networkReference to the client network
windowReference to the SFML render window

Definition at line 21 of file RoomWaitingScene.cpp.

Member Function Documentation

◆ closeChat()

void rtp::client::scenes::RoomWaitingScene::closeChat ( void  )
private

◆ handleEvent()

void rtp::client::scenes::RoomWaitingScene::handleEvent ( const sf::Event &  event)
overridevirtual

Handle an incoming event.

Parameters
eventThe event to handle.

Implements rtp::client::interfaces::IScene.

Definition at line 125 of file RoomWaitingScene.cpp.

◆ onEnter()

◆ onExit()

void rtp::client::scenes::RoomWaitingScene::onExit ( void  )
overridevirtual

Called when the scene is exited.

Implements rtp::client::interfaces::IScene.

Definition at line 120 of file RoomWaitingScene.cpp.

References closeChat().

◆ openChat()

◆ sendChatMessage()

void rtp::client::scenes::RoomWaitingScene::sendChatMessage ( void  )
private

◆ update()

◆ updateChatHistoryText()

void rtp::client::scenes::RoomWaitingScene::updateChatHistoryText ( void  )
private

Member Data Documentation

◆ _changeState

ChangeStateFn rtp::client::scenes::RoomWaitingScene::_changeState
private

Function to change the game state.

Definition at line 81 of file RoomWaitingScene.hpp.

Referenced by onEnter(), and update().

◆ _chatCompactPanel

ecs::Entity rtp::client::scenes::RoomWaitingScene::_chatCompactPanel {}
private

Compact chat background panel.

Definition at line 86 of file RoomWaitingScene.hpp.

Referenced by onEnter().

◆ _chatCompactText

ecs::Entity rtp::client::scenes::RoomWaitingScene::_chatCompactText {}
private

Text entity for last chat message.

Definition at line 87 of file RoomWaitingScene.hpp.

Referenced by onEnter(), and update().

◆ _chatHistoryText

ecs::Entity rtp::client::scenes::RoomWaitingScene::_chatHistoryText {}
private

Text entity for chat history.

Definition at line 91 of file RoomWaitingScene.hpp.

Referenced by closeChat(), openChat(), and updateChatHistoryText().

◆ _chatInput

ecs::Entity rtp::client::scenes::RoomWaitingScene::_chatInput {}
private

Text input entity for chat.

Definition at line 92 of file RoomWaitingScene.hpp.

Referenced by closeChat(), openChat(), and sendChatMessage().

◆ _chatOpen

bool rtp::client::scenes::RoomWaitingScene::_chatOpen = false
private

Whether expanded chat is open.

Definition at line 84 of file RoomWaitingScene.hpp.

Referenced by closeChat(), onEnter(), openChat(), and update().

◆ _chatPanel

ecs::Entity rtp::client::scenes::RoomWaitingScene::_chatPanel {}
private

Expanded chat panel.

Definition at line 90 of file RoomWaitingScene.hpp.

Referenced by closeChat(), and openChat().

◆ _chatToggleButton

ecs::Entity rtp::client::scenes::RoomWaitingScene::_chatToggleButton {}
private

Toggle button for chat.

Definition at line 88 of file RoomWaitingScene.hpp.

Referenced by onEnter().

◆ _network

NetworkSyncSystem& rtp::client::scenes::RoomWaitingScene::_network
private

Reference to the client network.

Definition at line 79 of file RoomWaitingScene.hpp.

Referenced by onEnter(), sendChatMessage(), update(), and updateChatHistoryText().

◆ _settings

Settings& rtp::client::scenes::RoomWaitingScene::_settings
private

Reference to the application settings.

Definition at line 77 of file RoomWaitingScene.hpp.

◆ _translationManager

TranslationManager& rtp::client::scenes::RoomWaitingScene::_translationManager
private

Reference to the translation manager.

Definition at line 78 of file RoomWaitingScene.hpp.

◆ _uiFactory

graphics::UiFactory& rtp::client::scenes::RoomWaitingScene::_uiFactory
private

UI Factory for creating UI components.

Definition at line 80 of file RoomWaitingScene.hpp.

Referenced by onEnter(), and openChat().

◆ _uiReady

bool rtp::client::scenes::RoomWaitingScene::_uiReady = false
private

Player ready status in the UI.

Definition at line 83 of file RoomWaitingScene.hpp.

Referenced by onEnter().

◆ _uiRegistry

ecs::Registry& rtp::client::scenes::RoomWaitingScene::_uiRegistry
private

Reference to the ECS registry.

Definition at line 76 of file RoomWaitingScene.hpp.

Referenced by closeChat(), onEnter(), openChat(), sendChatMessage(), update(), and updateChatHistoryText().


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