From 5937d893da5656be3f486c863ae54e08bbe66579 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Tue, 9 Aug 2022 16:57:53 -0400
Subject: Added generic items, worked on features

---
 src/battlescape/battlescape.h | 50 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 src/battlescape/battlescape.h

(limited to 'src/battlescape')

diff --git a/src/battlescape/battlescape.h b/src/battlescape/battlescape.h
new file mode 100644
index 0000000..a170ad3
--- /dev/null
+++ b/src/battlescape/battlescape.h
@@ -0,0 +1,50 @@
+#pragma once
+#include <vector>
+#include <memory>
+#include <string>
+#include <nlohmann/json.hpp>
+#include <tuple>
+#include <cstddef> // 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<std::size_t,std::size_t,std::size_t> coord3d;
+
+    class Battlescape {
+        public:
+            Battlescape();
+            // Also can be created programmatically
+            Battlescape(std::vector<std::vector<std::vector<Tile>>> terrain);
+
+            // Getters
+            std::map<std::shared_ptr<entry::Entry>, coord3d> getContents(void) const;
+            
+            // Setters
+            bool place(std::shared_ptr<entry::Entry> thing, const coord3d& position);
+            bool remove(std::shared_ptr<entry::Entry> thing, const coord3d& position);
+            bool move(std::shared_ptr<entry::Entry> 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<battlescapeImpl> data;
+    };
+}
-- 
cgit v1.2.3