|
R-Type
Distributed multiplayer game engine in C++
|
#include <optional>#include <string>#include <unordered_map>

Go to the source code of this file.
Namespaces | |
| namespace | GameruleKeys |
Enumerations | |
| enum class | GameruleKey { PLAYER_SPEED , PLAYER_HEALTH , PLAYER_FIRE_RATE , PLAYER_DAMAGE , PLAYER_SPAWN_X , PLAYER_SPAWN_Y , GAME_SPEED_MULTIPLIER } |
| Type-safe enum for gamerule identifiers. More... | |
Functions | |
| const char * | GameruleKeys::toString (GameruleKey key) |
| Convert GameruleKey enum to string. | |
| std::optional< GameruleKey > | GameruleKeys::fromString (const std::string &str) |
| Convert string to GameruleKey enum (optional, for deserialization) | |
Variables | |
| static constexpr const char * | GameruleKeys::PLAYER_SPEED = "player.speed" |
| static constexpr const char * | GameruleKeys::PLAYER_HEALTH = "player.health" |
| static constexpr const char * | GameruleKeys::PLAYER_FIRE_RATE = "player.fireRate" |
| static constexpr const char * | GameruleKeys::PLAYER_DAMAGE = "player.damage" |
| static constexpr const char * | GameruleKeys::PLAYER_SPAWN_X = "player.spawnX" |
| static constexpr const char * | GameruleKeys::PLAYER_SPAWN_Y = "player.spawnY" |
|
strong |
Type-safe enum for gamerule identifiers.
Using an enum instead of raw strings prevents typos and makes the code more maintainable.
| Enumerator | |
|---|---|
| PLAYER_SPEED | |
| PLAYER_HEALTH | |
| PLAYER_FIRE_RATE | |
| PLAYER_DAMAGE | |
| PLAYER_SPAWN_X | |
| PLAYER_SPAWN_Y | |
| GAME_SPEED_MULTIPLIER | Game speed multiplier (0.25 to 1.0, accessibility feature) |
Definition at line 20 of file GameruleKeys.hpp.