diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-02-02 18:33:21 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-02-02 18:33:21 +0100 |
commit | 34857eabbcaea2344fe7912f96fbd7f854c37e1b (patch) | |
tree | 9603f90b3cba412b2d0de321b7cbc8e6c4012fd4 /src/Info.hpp | |
parent | db59b7385621a271684c3be5f20618d74e631dda (diff) | |
download | MinedMap-34857eabbcaea2344fe7912f96fbd7f854c37e1b.tar MinedMap-34857eabbcaea2344fe7912f96fbd7f854c37e1b.zip |
Add spawn coordinates
Diffstat (limited to 'src/Info.hpp')
-rw-r--r-- | src/Info.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Info.hpp b/src/Info.hpp index 6f69c56..478e858 100644 --- a/src/Info.hpp +++ b/src/Info.hpp @@ -29,6 +29,7 @@ #include <climits> #include <cstdint> #include <set> +#include <tuple> #include <utility> @@ -39,8 +40,10 @@ private: std::set<std::pair<int, int>> regions; int minX, maxX, minZ, maxZ; + int32_t spawnX, spawnZ; + public: - Info() : minX(INT_MAX), maxX(INT_MIN), minZ(INT_MAX), maxZ(INT_MIN) {} + Info() : minX(INT_MAX), maxX(INT_MIN), minZ(INT_MAX), maxZ(INT_MIN), spawnX(0), spawnZ(0) {} void addRegion(int x, int z) { regions.insert(std::make_pair(x, z)); @@ -51,6 +54,10 @@ public: if (z > maxZ) maxZ = z; } + void setSpawn(const std::pair<int32_t, int32_t> &v) { + std::tie(spawnX, spawnZ) = v; + } + void writeJSON(const char *filename); }; |