aboutsummaryrefslogtreecommitdiffstats
path: root/include/world/map.h
blob: 7729ecf36e9cf8f6628d71b1ce5057df35c47a31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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