Very simple items system to get into the inventory work.

This commit is contained in:
Zed A. Shaw 2025-01-01 13:21:01 -05:00
parent 1962b0c24e
commit 3d461bce6d
15 changed files with 94 additions and 32 deletions

View file

@ -1,6 +1,9 @@
#include "config.hpp"
#include "dbc.hpp"
#include <fmt/core.h>
using nlohmann::json;
using fmt::format;
Config::Config(const std::string src_path) : $src_path(src_path) {
std::ifstream infile($src_path);
@ -8,6 +11,7 @@ Config::Config(const std::string src_path) : $src_path(src_path) {
}
json &Config::operator[](const std::string &key) {
dbc::check($config.contains(key), format("ERROR in config, key {} doesn't exist.", key));
return $config[key];
}