5#ifndef TILESON_WORLDMAPDATA_HPP
6#define TILESON_WORLDMAPDATA_HPP
14 inline void parse(
const fs::path &folder_,
IJson &json);
35 if(json.
count(
"fileName") > 0)
fileName = json[
"fileName"].
get<std::string>();
36 if(json.
count(
"height") > 0)
size = {json[
"width"].
get<
int>(), json[
"height"].get<int>()};
37 if(json.
count(
"x") > 0)
position = {json[
"x"].
get<
int>(), json[
"y"].get<int>()};
T get(std::string_view key)
Definition IJson.hpp:82
virtual size_t count(std::string_view key) const =0
Definition WorldMapData.hpp:11
void parse(const fs::path &folder_, IJson &json)
Definition WorldMapData.hpp:32
std::string fileName
Definition WorldMapData.hpp:22
tson::Vector2i position
Definition WorldMapData.hpp:24
fs::path path
Definition WorldMapData.hpp:21
WorldMapData(const fs::path &folder_, IJson &json)
Definition WorldMapData.hpp:27
fs::path folder
Definition WorldMapData.hpp:20
tson::Vector2i size
Definition WorldMapData.hpp:23