Basic tile map implemented.
This commit is contained in:
parent
290affa49a
commit
b66a3154c7
9 changed files with 135 additions and 12 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "config.hpp"
|
||||
|
||||
using nlohmann::json;
|
||||
|
||||
Config::Config(const std::string src_path) : $src_path(src_path) {
|
||||
std::ifstream infile($src_path);
|
||||
$config = json::parse(infile);
|
||||
|
@ -9,6 +11,12 @@ json &Config::operator[](const std::string &key) {
|
|||
return $config[key];
|
||||
}
|
||||
|
||||
std::wstring Config::wstring(const std::string key) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> $converter;
|
||||
const std::string& str_val = $config[key];
|
||||
return $converter.from_bytes(str_val);
|
||||
}
|
||||
|
||||
std::wstring Config::wstring(const std::string main_key, const std::string sub_key) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> $converter;
|
||||
const std::string& str_val = $config[main_key][sub_key];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue