summaryrefslogtreecommitdiffstats
path: root/src/model/Map.hpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 17:39:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-24 17:39:36 +0200
commitefa8640aabb3b4df31531ecd41ed1073dda63ed2 (patch)
tree151ddb75a5866784ce6b65757e0eea68aee6e05b /src/model/Map.hpp
parentaadcecf2022ec13d15da5d816567779740a37da7 (diff)
downloadrpgedit-efa8640aabb3b4df31531ecd41ed1073dda63ed2.tar
rpgedit-efa8640aabb3b4df31531ecd41ed1073dda63ed2.zip
Make MapContext keep a complete copy of the map
Diffstat (limited to 'src/model/Map.hpp')
-rw-r--r--src/model/Map.hpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/model/Map.hpp b/src/model/Map.hpp
index 77a67be..421b487 100644
--- a/src/model/Map.hpp
+++ b/src/model/Map.hpp
@@ -27,6 +27,7 @@
#pragma once
#include <cstdint>
+#include <deque>
#include <memory>
#include <stdexcept>
#include <vector>
@@ -44,7 +45,7 @@ private:
size_t width, height;
std::vector<std::vector<uint32_t>> tiles;
- std::vector<Entity> entities;
+ std::deque<Entity> entities;
Map(size_t width0, size_t height0, size_t layers)
@@ -62,11 +63,11 @@ public:
return tileset;
}
- std::vector<Entity> & getEntities() {
+ std::deque<Entity> & getEntities() {
return entities;
}
- const std::vector<Entity> & getEntities() const {
+ const std::deque<Entity> & getEntities() const {
return entities;
}
@@ -96,7 +97,7 @@ public:
return tiles[layer][y*width + x];
}
- static std::shared_ptr<Map> load(const std::string &name);
+ static std::unique_ptr<Map> load(const std::string &name);
};
}