5#ifndef TILESON_WANGTILE_HPP
6#define TILESON_WANGTILE_HPP
19 [[nodiscard]]
inline bool hasDFlip()
const;
20 [[nodiscard]]
inline bool hasHFlip()
const;
21 [[nodiscard]]
inline uint32_t
getTileid()
const;
22 [[nodiscard]]
inline bool hasVFlip()
const;
24 [[nodiscard]]
inline const std::vector<uint32_t> &
getWangIds()
const;
31 std::vector<uint32_t> m_wangId;
49 if(json.
count(
"dflip") > 0) m_dflip = json[
"dflip"].
get<
bool>();
50 if(json.
count(
"hflip") > 0) m_hflip = json[
"hflip"].get<bool>();
51 if(json.
count(
"vflip") > 0) m_vflip = json[
"vflip"].get<bool>();
53 if(json.
count(
"tileid") > 0) m_tileid = json[
"tileid"].get<uint32_t>();
else allFound =
false;
56 auto &wangid = json.
array(
"wangid");
57 std::for_each(wangid.begin(), wangid.end(), [&](std::unique_ptr<IJson> &item) { m_wangId.emplace_back(item->get<uint32_t>()); });
T get(std::string_view key)
Definition IJson.hpp:82
virtual bool isArray() const =0
virtual size_t count(std::string_view key) const =0
virtual std::vector< std::unique_ptr< IJson > > array()=0
Definition WangTile.hpp:13
bool hasHFlip() const
Definition WangTile.hpp:80
bool hasDFlip() const
Definition WangTile.hpp:69
uint32_t getTileid() const
Definition WangTile.hpp:89
bool parse(IJson &json)
Definition WangTile.hpp:45
bool hasVFlip() const
Definition WangTile.hpp:100
const std::vector< uint32_t > & getWangIds() const
Definition WangTile.hpp:109