Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
console_variables.hpp File Reference

Console variables: named, typed settings with a default, a description and flags. More...

#include <aegis2d/core/export.hpp>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <map>
#include <optional>
#include <string>
#include <string_view>
#include <variant>
#include <vector>

Go to the source code of this file.

Classes

struct  aegis2d::core::VarFlags
 What a console variable allows: {.saved = true, .cheat = true}. More...
 
struct  aegis2d::core::VarInfo
 A console variable as declared, with its value now. More...
 
class  aegis2d::core::ConsoleVariables
 The settings a console reads and changes by name while the game runs. More...
 

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::core
 Logging, time, main loop, events and configuration shared by client and server.
 

Typedefs

using aegis2d::core::VarValue = std::variant< bool, std::int64_t, double, std::string >
 Value of a console variable: a boolean, an integer, a number or a text.
 

Enumerations

enum class  aegis2d::core::VarResult : std::uint8_t {
  aegis2d::core::Changed , aegis2d::core::Unknown , aegis2d::core::ReadOnly , aegis2d::core::Cheat ,
  aegis2d::core::WrongType , aegis2d::core::BadText
}
 What became of a change of a console variable. More...
 

Functions

std::string_view aegis2d::core::to_string (VarResult result) noexcept
 Sentence for a VarResult, as a console shows it.
 
std::string aegis2d::core::to_text (const VarValue &value)
 A value as text, as ConsoleVariables::set_text() reads it.
 
std::optional< VarValue > aegis2d::core::read_value (std::string_view text, const VarValue &like)
 Reads a value from text, in the type of another one, as ConsoleVariables::set_text() does.
 
bool aegis2d::core::is_console_name (std::string_view name) noexcept
 Tells whether a name is valid for a console variable or a command.
 

Detailed Description

Console variables: named, typed settings with a default, a description and flags.