R-Type 0.1
Loading...
Searching...
No Matches
rtype::client::NetworkConnectionScene Class Reference

Connection screen, which sends Hello every second until the server answers or 10 seconds pass. More...

#include <scene/networkConnectionScene.hpp>

Public Member Functions

 NetworkConnectionScene (rtk::RenderWindow &)
 Creates the scene.
 
void onEnter (rtk::EngineContext &context)
 Subscribes to the connection result events.
 
std::optional< SceneType > onUpdate (rtk::EngineContext &context, const rtk::InputState &, float dt)
 Retries the handshake and picks the next scene.
 
void onExit (rtk::EngineContext &)
 Does nothing.
 

Static Public Attributes

static constexpr SceneType Type = SceneType::Connection
 Identifier of this scene.
 

Detailed Description

Connection screen, which sends Hello every second until the server answers or 10 seconds pass.

Member Function Documentation

◆ onEnter()

void rtype::client::NetworkConnectionScene::onEnter ( rtk::EngineContext & context)
inline

Subscribes to the connection result events.

Parameters
contextEngine services.

◆ onUpdate()

std::optional< SceneType > rtype::client::NetworkConnectionScene::onUpdate ( rtk::EngineContext & context,
const rtk::InputState & ,
float dt )
inline

Retries the handshake and picks the next scene.

Parameters
contextEngine services.
dtElapsed time since the last frame, in seconds.
Returns
Game once connected, Menu after the timeout, else std::nullopt.