aboutsummaryrefslogtreecommitdiff
path: root/extension/src/MapSingleton.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-03-30 23:50:50 +0200
committer Spartan322 <Megacake1234@gmail.com>2023-04-14 17:16:02 +0200
commitc0d76b78d3762e6eec3ed1c62618be84c5b7559b (patch)
treeacfcbeedd5a47136acdf883e791a297200b7d1b8 /extension/src/MapSingleton.hpp
parent1f04a7827ae377372cb491ff0257a47d0d4c2967 (diff)
Add terrain map
With Directional movement using WASD With Directional movement using arrow keys With Click-Drag movement using middle mouse button With Province identifiers With Province shape loading With Province rendering With Province selection With Province overview panel With Color lookup texture
Diffstat (limited to 'extension/src/MapSingleton.hpp')
-rw-r--r--extension/src/MapSingleton.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/extension/src/MapSingleton.hpp b/extension/src/MapSingleton.hpp
new file mode 100644
index 0000000..71761cd
--- /dev/null
+++ b/extension/src/MapSingleton.hpp
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <godot_cpp/classes/image.hpp>
+#include "openvic2/Map.hpp"
+
+namespace OpenVic2 {
+ class MapSingleton : public godot::Object {
+
+ GDCLASS(MapSingleton, godot::Object)
+
+ static MapSingleton* singleton;
+
+ godot::Ref<godot::Image> province_shape_image, province_index_image, province_colour_image;
+ int32_t width = 0, height = 0;
+ Map map;
+
+ protected:
+ static void _bind_methods();
+
+ public:
+ static MapSingleton* get_singleton();
+
+ MapSingleton();
+ ~MapSingleton();
+
+ godot::Error load_province_identifier_file(godot::String const& file_path);
+ godot::Error load_province_shape_file(godot::String const& file_path);
+ godot::String get_province_identifier_from_pixel_coords(godot::Vector2i const& coords);
+ int32_t get_width() const;
+ int32_t get_height() const;
+ godot::Ref<godot::Image> get_province_index_image() const;
+ godot::Ref<godot::Image> get_province_colour_image() const;
+ };
+}