summaryrefslogtreecommitdiffhomepage
path: root/tile/serialize.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tile/serialize.hpp')
-rw-r--r--tile/serialize.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tile/serialize.hpp b/tile/serialize.hpp
new file mode 100644
index 00000000..c28aa934
--- /dev/null
+++ b/tile/serialize.hpp
@@ -0,0 +1,23 @@
+#include <string>
+#include <vector>
+#include <tuple>
+#include <unordered_map>
+#include <Magnum/Magnum.h>
+#include <Magnum/Math/Vector2.h>
+
+namespace std::filesystem { class path; }
+
+struct big_atlas_tile final {
+ Magnum::Vector2i position;
+};
+
+struct big_atlas_entry final {
+ std::vector<big_atlas_tile> tiles;
+};
+
+struct big_atlas final {
+ static std::tuple<big_atlas, bool> from_json(const std::filesystem::path& pathname) noexcept;
+ [[nodiscard]] bool to_json(const std::filesystem::path& pathname) noexcept;
+
+ std::unordered_map<std::string, big_atlas_entry> entries;
+};