R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
GameruleKeys Namespace Reference

Functions

const char * toString (GameruleKey key)
 Convert GameruleKey enum to string.
 
std::optional< GameruleKeyfromString (const std::string &str)
 Convert string to GameruleKey enum (optional, for deserialization)
 

Variables

static constexpr const char * PLAYER_SPEED = "player.speed"
 
static constexpr const char * PLAYER_HEALTH = "player.health"
 
static constexpr const char * PLAYER_FIRE_RATE = "player.fireRate"
 
static constexpr const char * PLAYER_DAMAGE = "player.damage"
 
static constexpr const char * PLAYER_SPAWN_X = "player.spawnX"
 
static constexpr const char * PLAYER_SPAWN_Y = "player.spawnY"
 

Function Documentation

◆ fromString()

std::optional< GameruleKey > GameruleKeys::fromString ( const std::string &  str)
inline

Convert string to GameruleKey enum (optional, for deserialization)

Parameters
strThe string key
Returns
Optional GameruleKey if valid, nullopt otherwise

Definition at line 63 of file GameruleKeys.hpp.

References GAME_SPEED_MULTIPLIER, PLAYER_DAMAGE, PLAYER_FIRE_RATE, PLAYER_HEALTH, PLAYER_SPAWN_X, PLAYER_SPAWN_Y, and PLAYER_SPEED.

◆ toString()

Variable Documentation

◆ PLAYER_DAMAGE

constexpr const char* GameruleKeys::PLAYER_DAMAGE = "player.damage"
staticconstexpr

Definition at line 91 of file GameruleKeys.hpp.

◆ PLAYER_FIRE_RATE

constexpr const char* GameruleKeys::PLAYER_FIRE_RATE = "player.fireRate"
staticconstexpr

Definition at line 88 of file GameruleKeys.hpp.

◆ PLAYER_HEALTH

constexpr const char* GameruleKeys::PLAYER_HEALTH = "player.health"
staticconstexpr

Definition at line 85 of file GameruleKeys.hpp.

◆ PLAYER_SPAWN_X

constexpr const char* GameruleKeys::PLAYER_SPAWN_X = "player.spawnX"
staticconstexpr

Definition at line 94 of file GameruleKeys.hpp.

◆ PLAYER_SPAWN_Y

constexpr const char* GameruleKeys::PLAYER_SPAWN_Y = "player.spawnY"
staticconstexpr

Definition at line 97 of file GameruleKeys.hpp.

◆ PLAYER_SPEED

constexpr const char* GameruleKeys::PLAYER_SPEED = "player.speed"
staticconstexpr

Definition at line 82 of file GameruleKeys.hpp.