R-Type 0.1
Loading...
Searching...
No Matches

The r-type_client program: scenes, inputs, network client and backend adapters (src/Client). More...

Namespaces

namespace  rtype::Input
 Helpers to read client actions.
 

Classes

struct  rtype::events::PlayerShotEvent
 Published when the local player releases the shoot button. More...
 
class  rtype::client::Game
 Client side game: window, inputs, scenes and replication of the server world. More...
 
struct  rtype::client::NetworkEvent
 Connection event or raw message received from the server. More...
 
struct  rtype::client::ReplicationEvent
 Validated replication message received from the server. More...
 
class  rtype::client::NetworkClient
 UDP client that performs the handshake, sends inputs and decodes server messages. More...
 
class  rtype::client::RtkAudioAdapter
 Adapts the sound manager of the graphical library to the IsAudioManager concept. More...
 
class  RtkWindowAdapter
 Adapts the window of the graphical library to the IsRenderWindow concept. More...
 
class  rtype::client::GameScene
 In game scene, which shows the scrolling starfield. More...
 
class  rtype::client::MenuScene
 Title screen, which waits for the Confirm action. More...
 
class  rtype::client::NetworkConnectionScene
 Connection screen, which sends Hello every second until the server answers or 10 seconds pass. More...
 
class  rtk::systems::PlayerSystem
 Sends the local player actions to the server every frame and triggers the shot sound. More...
 

Typedefs

using rtype::client::ReplicationPayload
 Decoded replication message.
 

Enumerations

enum class  rtype::Action : uint32_t {
  Action::NoneAction = 0 , Action::Up = 1 << 0 , Action::Down = 1 << 1 , Action::Left = 1 << 2 ,
  Action::Right = 1 << 3 , Action::Shoot = 1 << 4 , Action::Confirm = 1 << 5
}
 Client actions, one bit of InputState::actionMask each. More...
 
enum class  rtype::client::NetworkEventType { NetworkEventType::Connected , NetworkEventType::Rejected , NetworkEventType::Disconnected , NetworkEventType::Message }
 Kind of event produced by the network client. More...
 
enum class  rtype::client::SceneType { SceneType::Menu , SceneType::Connection , SceneType::Game }
 Identifiers of the client scenes. More...
 

Functions

constexpr bool rtype::Input::hasAction (uint32_t engineMask, Action action)
 Tells whether an action is active in a mask.
 

Detailed Description

The r-type_client program: scenes, inputs, network client and backend adapters (src/Client).

Typedef Documentation

◆ ReplicationPayload

Initial value:
std::variant<protocol::CreateEntityPayload, protocol::DestroyEntityPayload,
protocol::SnapshotPayload>

Decoded replication message.

Enumeration Type Documentation

◆ Action

enum class rtype::Action : uint32_t
strong

Client actions, one bit of InputState::actionMask each.

Enumerator
NoneAction 

No action.

Up 

Move up.

Down 

Move down.

Left 

Move left.

Right 

Move right.

Shoot 

Shoot.

Confirm 

Validate a menu.

◆ NetworkEventType

Kind of event produced by the network client.

Enumerator
Connected 

The server sent Welcome.

Rejected 

The server sent Rejected.

Disconnected 

The connection was closed.

Message 

A message that is not a replication message.

◆ SceneType

enum class rtype::client::SceneType
strong

Identifiers of the client scenes.

Enumerator
Menu 

Title screen.

Connection 

Handshake with the server.

Game 

In game.

Function Documentation

◆ hasAction()

bool rtype::Input::hasAction ( uint32_t engineMask,
Action action )
nodiscardconstexpr

Tells whether an action is active in a mask.

Parameters
engineMaskAction mask of the frame.
actionAction to test.
Returns
True if the action bit is set.