Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
CreateRoomScene.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_CLIENT_SCENES_CREATEROOMSCENE_HPP_
9 #define RTYPE_CLIENT_SCENES_CREATEROOMSCENE_HPP_
10
11 #include "Interfaces/IScene.hpp"
12 #include "RType/ECS/Registry.hpp"
13 #include "UI/UiFactory.hpp"
14 #include "Utils/GameState.hpp"
16 #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 std::string _uiRoomName = "Room";
84 uint32_t _uiMaxPlayers = 4;
85 float _uiDifficulty = 0.5f;
86 float _uiSpeed = 1.0f;
87 uint32_t _uiDuration = 10;
88 uint32_t _uiSeed = 42;
89 uint32_t _uiLevelId = 1;
90 };
91 } // namespace scenes
92} // namespace rtp::client
93
94#endif // RTYPE_CLIENT_SCENES_CREATEROOMSCENE_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 creating a new game room.
uint32_t _uiLevelId
Level ID for the game.
ecs::Registry & _uiRegistry
Reference to the ECS registry.
void handleEvent(const sf::Event &event) override
Handle an incoming event.
graphics::UiFactory & _uiFactory
UI Factory for creating UI components.
ChangeStateFn _changeState
Function to change the game state.
float _uiSpeed
Game speed setting for the room.
TranslationManager & _translationManager
Reference to the translation manager.
std::function< void(GameState)> ChangeStateFn
Type alias for a function that changes the game state.
uint32_t _uiDuration
Duration of the game in minutes.
void onExit(void) override
Called when the scene is exited.
NetworkSyncSystem & _network
Reference to the client network.
void update(float dt) override
Update the scene state.
std::string _uiRoomName
Name of the room to be created.
uint32_t _uiSeed
Seed for random generation.
void onEnter(void) override
Called when the scene is entered.
float _uiDifficulty
Difficulty setting for the room.
Settings & _settings
Reference to the application settings.
uint32_t _uiMaxPlayers
Maximum number of players in the room.
R-Type client namespace.