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::SettingsScene Class Reference

Scene for the settings menu. More...

#include <SettingsScene.hpp>

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

Public Types

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

Public Member Functions

 SettingsScene (ecs::Registry &UiRegistry, Settings &settings, TranslationManager &translationManager, NetworkSyncSystem &network, graphics::UiFactory &uiFactory, std::function< void(GameState)> changeState)
 Constructor for SettingsScene.
 
void onEnter () override
 Called when the scene is entered.
 
void onExit () 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 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.
 

Detailed Description

Scene for the settings menu.

This scene allows users to configure various application settings, such as audio levels, graphics options, and key bindings.

Definition at line 31 of file SettingsScene.hpp.

Member Typedef Documentation

◆ ChangeStateFn

Type alias for a function that changes the game state.

Definition at line 51 of file SettingsScene.hpp.

Constructor & Destructor Documentation

◆ SettingsScene()

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

Constructor for SettingsScene.

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 20 of file SettingsScene.cpp.

Member Function Documentation

◆ handleEvent()

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

Handle an incoming event.

Parameters
eventThe event to handle.

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

Definition at line 238 of file SettingsScene.cpp.

References _changeState, and rtp::client::Menu.

◆ onEnter()

◆ onExit()

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

◆ update()

void rtp::client::scenes::SettingsScene::update ( float  dt)
overridevirtual

Update the scene state.

Parameters
dtTime delta since the last update.

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

Definition at line 247 of file SettingsScene.cpp.

Member Data Documentation

◆ _changeState

ChangeStateFn rtp::client::scenes::SettingsScene::_changeState
private

Function to change the game state.

Definition at line 81 of file SettingsScene.hpp.

Referenced by handleEvent(), and onEnter().

◆ _network

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

Reference to the client network.

Definition at line 79 of file SettingsScene.hpp.

◆ _settings

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

Reference to the application settings.

Definition at line 77 of file SettingsScene.hpp.

Referenced by onEnter(), and onExit().

◆ _translationManager

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

Reference to the translation manager.

Definition at line 78 of file SettingsScene.hpp.

Referenced by onEnter(), and onExit().

◆ _uiFactory

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

UI Factory for creating UI components.

Definition at line 80 of file SettingsScene.hpp.

Referenced by onEnter().

◆ _uiRegistry

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

Reference to the ECS registry.

Definition at line 76 of file SettingsScene.hpp.

Referenced by onEnter().


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