R-Type 0.1
Loading...
Searching...
No Matches
rtype::server::ServerLobbyScene Class Reference

Waiting room: starts the round with 2 players, or after 30 seconds with 1 player. More...

#include <Scene/serverLobbyScene.hpp>

Public Member Functions

 ServerLobbyScene (ServerDependency &dep)
 Creates the scene.
 
void onEnter (rtk::EngineContext &context)
 Resets the lobby timer.
 
std::optional< ServerSceneType > onUpdate (rtk::EngineContext &context, const ServerInput &input, float dt)
 Processes network events and starts the round when the conditions are met.
 
void onExit (rtk::EngineContext &context)
 Does nothing.
 

Static Public Attributes

static constexpr ServerSceneType Type = ServerSceneType::Lobby
 Identifier of this scene.
 

Detailed Description

Waiting room: starts the round with 2 players, or after 30 seconds with 1 player.

Constructor & Destructor Documentation

◆ ServerLobbyScene()

rtype::server::ServerLobbyScene::ServerLobbyScene ( ServerDependency & dep)

Creates the scene.

Parameters
depGame that owns the scene.

Member Function Documentation

◆ onEnter()

void rtype::server::ServerLobbyScene::onEnter ( rtk::EngineContext & context)

Resets the lobby timer.

Parameters
contextEngine services.

◆ onUpdate()

std::optional< ServerSceneType > rtype::server::ServerLobbyScene::onUpdate ( rtk::EngineContext & context,
const ServerInput & input,
float dt )

Processes network events and starts the round when the conditions are met.

Parameters
contextEngine services.
inputUnused.
dtElapsed time since the last frame, in seconds.
Returns
The next scene, or std::nullopt to stay.

◆ onExit()

void rtype::server::ServerLobbyScene::onExit ( rtk::EngineContext & context)

Does nothing.

Parameters
contextEngine services.