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

#include <GameOverScene.hpp>

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

Public Types

using ChangeStateFn = std::function< void(GameState)>
 

Public Member Functions

 GameOverScene (ecs::Registry &UiRegistry, Settings &settings, TranslationManager &translationManager, NetworkSyncSystem &network, graphics::UiFactory &uiFactory, std::function< void(GameState)> changeState)
 
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 Attributes

ecs::Registry_uiRegistry
 
Settings_settings
 
TranslationManager_translationManager
 
NetworkSyncSystem_network
 
graphics::UiFactory_uiFactory
 
ChangeStateFn _changeState
 

Detailed Description

Definition at line 23 of file GameOverScene.hpp.

Member Typedef Documentation

◆ ChangeStateFn

Definition at line 33 of file GameOverScene.hpp.

Constructor & Destructor Documentation

◆ GameOverScene()

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

Definition at line 13 of file GameOverScene.cpp.

Member Function Documentation

◆ handleEvent()

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

Handle an incoming event.

Parameters
eventThe event to handle.

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

Definition at line 82 of file GameOverScene.cpp.

References _changeState, _network, rtp::client::Menu, and rtp::client::NetworkSyncSystem::tryLeaveRoom().

◆ onEnter()

◆ onExit()

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

Called when the scene is exited.

Note
Used for cleaning up scene-specific resources.

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

Definition at line 77 of file GameOverScene.cpp.

References rtp::log::info().

◆ update()

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

Update the scene state.

Parameters
dtTime delta since the last update.

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

Definition at line 93 of file GameOverScene.cpp.

Member Data Documentation

◆ _changeState

ChangeStateFn rtp::client::scenes::GameOverScene::_changeState
private

Definition at line 46 of file GameOverScene.hpp.

Referenced by handleEvent(), and onEnter().

◆ _network

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

Definition at line 44 of file GameOverScene.hpp.

Referenced by handleEvent(), and onEnter().

◆ _settings

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

Definition at line 42 of file GameOverScene.hpp.

◆ _translationManager

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

Definition at line 43 of file GameOverScene.hpp.

◆ _uiFactory

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

Definition at line 45 of file GameOverScene.hpp.

Referenced by onEnter().

◆ _uiRegistry

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

Definition at line 41 of file GameOverScene.hpp.

Referenced by onEnter().


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