Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
RoomWaitingScene.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_CLIENT_SCENES_ROOMWAITINGSCENE_HPP_
9 #define RTYPE_CLIENT_SCENES_ROOMWAITINGSCENE_HPP_
10
11 #include "Interfaces/IScene.hpp"
12 #include "RType/ECS/Registry.hpp"
13 #include "UI/UiFactory.hpp"
14 #include "Utils/GameState.hpp"
15 #include "Systems/NetworkSyncSystem.hpp"
17 #include "Core/Settings.hpp"
18 #include <SFML/Graphics.hpp>
19 #include <memory>
20 #include <functional>
21
22namespace rtp::client {
23 namespace scenes {
32 {
33 public:
42 Settings& settings,
43 TranslationManager& translationManager,
44 NetworkSyncSystem& network,
45 graphics::UiFactory& uiFactory,
46 std::function<void(GameState)> changeState);
47
51 using ChangeStateFn = std::function<void(GameState)>;
52
56 void onEnter(void) override;
57
61 void onExit(void) override;
62
67 void handleEvent(const sf::Event& event) override;
68
73 void update(float dt) override;
74
75 private:
83 bool _uiReady = false;
84 bool _chatOpen = false;
94 void openChat(void);
95 void closeChat(void);
96 void updateChatHistoryText(void);
97 void sendChatMessage(void);
98 };
99 } // namespace scenes
100} // namespace rtp::client
101
102#endif // RTYPE_CLIENT_SCENES_ROOMWAITINGSCENE_HPP_
System to handle network-related operations on the client side.
Manages game settings and preferences.
Definition Settings.hpp:67
Manages game translations for all UI elements.
Factory class for creating UI components in the ECS registry.
Definition UiFactory.hpp:72
Interface for different scenes in the client application.
Definition IScene.hpp:23
Scene for waiting in a game room.
ChangeStateFn _changeState
Function to change the game state.
NetworkSyncSystem & _network
Reference to the client network.
TranslationManager & _translationManager
Reference to the translation manager.
graphics::UiFactory & _uiFactory
UI Factory for creating UI components.
ecs::Entity _chatCompactPanel
Compact chat background panel.
void update(float dt) override
Update the scene state.
void onExit(void) override
Called when the scene is exited.
ecs::Entity _chatToggleButton
Toggle button for chat.
ecs::Registry & _uiRegistry
Reference to the ECS registry.
void onEnter(void) override
Called when the scene is entered.
Settings & _settings
Reference to the application settings.
bool _uiReady
Player ready status in the UI.
ecs::Entity _chatInput
Text input entity for chat.
void handleEvent(const sf::Event &event) override
Handle an incoming event.
bool _chatOpen
Whether expanded chat is open.
std::function< void(GameState)> ChangeStateFn
Type alias for a function that changes the game state.
ecs::Entity _chatPanel
Expanded chat panel.
ecs::Entity _chatHistoryText
Text entity for chat history.
ecs::Entity _chatCompactText
Text entity for last chat message.
Represents an entity in the ECS (Entity-Component-System) architecture.
Definition Entity.hpp:63
R-Type client namespace.