Very simple items system to get into the inventory work.
This commit is contained in:
parent
1962b0c24e
commit
3d461bce6d
15 changed files with 94 additions and 32 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue