ChessPlusPlus
WIP
cplusplus.com Community Project
|
Holds configuration values for the board (layout, metadata, etc) More...
#include <BoardConfig.hpp>
Public Types | |
using | BoardSize_t = std::uint8_t |
using | CellSize_t = std::uint16_t |
using | Position_t = util::Position< BoardSize_t > |
using | PieceClass_t = std::string |
using | SuitClass_t = std::string |
using | Layout_t = std::map< Position_t, std::pair< PieceClass_t, SuitClass_t >> |
using | Textures_t = std::map< BoardConfig::SuitClass_t, std::map< BoardConfig::PieceClass_t, std::string >> |
Public Member Functions | |
BoardConfig (ResourcesConfig &res) | |
Loads board configuration from "config/chesspp/board.json". More... | |
virtual | ~BoardConfig ()=default |
BoardSize_t | boardWidth () const noexcept |
BoardSize_t | boardHeight () const noexcept |
Layout_t const & | initialLayout () const noexcept |
CellSize_t | cellWidth () const noexcept |
CellSize_t | cellHeight () const noexcept |
Textures_t const & | texturePaths () const noexcept |
template<typename... Args> | |
util::JsonReader::NestedValue | metadata (Args const &...path) const |
Get metadata for the board pieces. More... | |
Public Member Functions inherited from chesspp::config::Configuration | |
Configuration (std::string const &configFile) noexcept(false) | |
Loads the configuration from the given file path. More... | |
virtual | ~Configuration ()=default |
template<typename... Path> | |
auto | setting (Path const &...path) -> decltype(reader.navigate(path...)) |
Access values in the configuration. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from chesspp::config::Configuration | |
static std::string | executablePath () |
Get the path to the directory the executable is in. More... | |
Protected Attributes inherited from chesspp::config::Configuration | |
std::string | res_path |
Stores the path to the directory where configuration paths are relative to. More... | |
util::JsonReader | reader |
The chessp::util::JsonReader for reading the configuration values. More... | |
Holds configuration values for the board (layout, metadata, etc)
using chesspp::config::BoardConfig::BoardSize_t = std::uint8_t |
using chesspp::config::BoardConfig::CellSize_t = std::uint16_t |
using chesspp::config::BoardConfig::Layout_t = std::map<Position_t, std::pair<PieceClass_t, SuitClass_t>> |
using chesspp::config::BoardConfig::PieceClass_t = std::string |
using chesspp::config::BoardConfig::SuitClass_t = std::string |
using chesspp::config::BoardConfig::Textures_t = std::map<BoardConfig::SuitClass_t, std::map<BoardConfig::PieceClass_t, std::string>> |
|
inline |
Loads board configuration from "config/chesspp/board.json".
The | ResourcesConfig to use for resource configuration. |
|
virtualdefault |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Get metadata for the board pieces.
Equivalent to calling setting("board", "metadata", ...)
|
inlinenoexcept |