Rooms are now styled randomly based on assets/styles.json which will evolve into specifications for themes of levels and rooms in them plus other configs.

This commit is contained in:
Zed A. Shaw 2025-05-30 20:35:17 -04:00
parent e45de2a2cf
commit d2a5dfa713
7 changed files with 56 additions and 2 deletions

View file

@ -15,6 +15,10 @@ Config::Config(const std::string src_path) : $src_path(src_path) {
$config = json::parse(infile);
}
nlohmann::json &Config::operator[](size_t key) {
return $config[key];
}
json &Config::operator[](const std::string &key) {
dbc::check($config.contains(key), fmt::format("ERROR in config, key {} doesn't exist.", key));
return $config[key];