aboutsummaryrefslogtreecommitdiffstats
path: root/include/world/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/world/map.h')
-rw-r--r--include/world/map.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/world/map.h b/include/world/map.h
new file mode 100644
index 0000000..7729ecf
--- /dev/null
+++ b/include/world/map.h
@@ -0,0 +1,48 @@
+#ifndef POSTMODERN_WORLD_MAP_H
+#define POSTMODERN_WORLD_MAP_H 1
+
+#include <memory>
+#include <random>
+
+#include "boxii/window.h"
+
+class WorldMap;
+
+class GenerationPhase {
+private:
+public:
+ GenerationPhase(std::shared_ptr<GenerationPhase> prev, std::shared_ptr<WorldMap> map) {}
+ ~GenerationPhase() {}
+};
+
+//1.024 km tile resolution
+class WorldMap {
+private:
+ int m_width;
+ int m_height;
+ int m_seed;
+
+ float *m_landElevation;
+ float *m_waterElevation;
+ float *m_vegetation;
+
+ std::mt19937 m_random;
+
+public:
+ WorldMap(int w, int h, int seed);
+ ~WorldMap();
+
+ void begin(std::shared_ptr<WorldMap> self);
+ void draw(std::shared_ptr<Boxii::Window> window, int zoom);
+
+ void getProperties(int x, int y, float &le, float &we, float &v);
+ void setProperties(int x, int y, float le, float we, float v);
+
+ int getWidth() { return m_width; }
+ int getHeight() { return m_height; }
+ int getSeed() { return m_seed; }
+
+ std::mt19937 &getRandom() { return m_random; }
+};
+
+#endif