#pragma once #include #include #include #include #include #include // size_t #include "../entry.h" namespace battlescape { struct battlescapeImpl; struct Tile { std::string name; std::string description; char look; int color; }; NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Tile, name, description, look, color); typedef std::tuple coord3d; class Battlescape { public: Battlescape(); // Also can be created programmatically Battlescape(std::vector>> terrain); // Getters std::map, coord3d> getContents(void) const; // Setters bool place(std::shared_ptr thing, const coord3d& position); bool remove(std::shared_ptr thing, const coord3d& position); bool move(std::shared_ptr thing, const coord3d& from, const coord3d& to) { if(place(thing, to)) { if(remove(thing, from)) { return true; } remove(thing, to); } return false; } NLOHMANN_FRIEND_DECLARES(Battlescape); private: std::shared_ptr data; }; }