MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
space::NetworkState Struct Reference

Complete replicated gameplay state published by one player. More...

#include <examples/asteroids-net/multiplayer.hpp>

Public Attributes

std::array< NetworkAsteroid, NETWORK_ASTEROID_COUNTasteroids {}
 Host-authoritative asteroids.
std::array< std::uint32_t, NETWORK_PLAYER_COUNTconsumed_projectile_ids {}
 Last consumed projectile per player.
float current_speed = 1.0f
 Ship forward speed.
std::array< std::uint32_t, NETWORK_PLAYER_COUNTdeath_serials {}
 Monotonic death events by player slot.
std::uint8_t exploding = 0
 Nonzero while the ship is exploding.
std::array< std::uint32_t, NETWORK_PLAYER_COUNTkills {}
 Kill counters by player slot.
std::uint8_t match_started = 0
 Nonzero after the host starts the match.
std::array< float, 3 > position {}
 Ship world-space position.
std::array< NetworkProjectile, NETWORK_PROJECTILE_COUNTprojectiles {}
 Locally owned projectiles.
std::array< float, 3 > rotation {}
 Ship Euler rotation in degrees.
std::uint8_t winner = 0
 Winning player identifier, or zero if unset.

Detailed Description

Complete replicated gameplay state published by one player.

Definition at line 57 of file multiplayer.hpp.

Member Data Documentation

◆ asteroids

std::array<NetworkAsteroid, NETWORK_ASTEROID_COUNT> space::NetworkState::asteroids {}

Host-authoritative asteroids.

Definition at line 62 of file multiplayer.hpp.

62{}; ///< Host-authoritative asteroids.

◆ consumed_projectile_ids

std::array<std::uint32_t, NETWORK_PLAYER_COUNT> space::NetworkState::consumed_projectile_ids {}

Last consumed projectile per player.

Definition at line 65 of file multiplayer.hpp.

65{}; ///< Last consumed projectile per player.

◆ current_speed

float space::NetworkState::current_speed = 1.0f

Ship forward speed.

Definition at line 60 of file multiplayer.hpp.

◆ death_serials

std::array<std::uint32_t, NETWORK_PLAYER_COUNT> space::NetworkState::death_serials {}

Monotonic death events by player slot.

Definition at line 64 of file multiplayer.hpp.

64{}; ///< Monotonic death events by player slot.

◆ exploding

std::uint8_t space::NetworkState::exploding = 0

Nonzero while the ship is exploding.

Definition at line 66 of file multiplayer.hpp.

◆ kills

std::array<std::uint32_t, NETWORK_PLAYER_COUNT> space::NetworkState::kills {}

Kill counters by player slot.

Definition at line 63 of file multiplayer.hpp.

63{}; ///< Kill counters by player slot.

◆ match_started

std::uint8_t space::NetworkState::match_started = 0

Nonzero after the host starts the match.

Definition at line 67 of file multiplayer.hpp.

◆ position

std::array<float, 3> space::NetworkState::position {}

Ship world-space position.

Definition at line 58 of file multiplayer.hpp.

58{}; ///< Ship world-space position.

◆ projectiles

std::array<NetworkProjectile, NETWORK_PROJECTILE_COUNT> space::NetworkState::projectiles {}

Locally owned projectiles.

Definition at line 61 of file multiplayer.hpp.

61{}; ///< Locally owned projectiles.

◆ rotation

std::array<float, 3> space::NetworkState::rotation {}

Ship Euler rotation in degrees.

Definition at line 59 of file multiplayer.hpp.

59{}; ///< Ship Euler rotation in degrees.

◆ winner

std::uint8_t space::NetworkState::winner = 0

Winning player identifier, or zero if unset.

Definition at line 68 of file multiplayer.hpp.


The documentation for this struct was generated from the following file: