summaryrefslogtreecommitdiffstats
path: root/src/control/MapContext.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/control/MapContext.hpp
parentaadcecf2022ec13d15da5d816567779740a37da7 (diff)
downloadrpgedit-efa8640aabb3b4df31531ecd41ed1073dda63ed2.tar
rpgedit-efa8640aabb3b4df31531ecd41ed1073dda63ed2.zip
Make MapContext keep a complete copy of the map
Diffstat (limited to 'src/control/MapContext.hpp')
-rw-r--r--src/control/MapContext.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/control/MapContext.hpp b/src/control/MapContext.hpp
index a9481a6..a60bdfc 100644
--- a/src/control/MapContext.hpp
+++ b/src/control/MapContext.hpp
@@ -44,11 +44,9 @@ private:
EventBus *const eventBus;
InputHandler *const inputHandler;
- View::MapView *const view;
+ std::unique_ptr<View::MapView> view;
- std::shared_ptr<const Model::Map> map;
-
- std::vector<std::unique_ptr<Model::Entity>> entities;
+ Model::Map map;
Model::Entity *playerEntity;
void movePlayer(Model::Direction dir, uint64_t time);
@@ -60,10 +58,10 @@ private:
}
public:
- MapContext(EventBus *eventBus0, InputHandler *inputHandler0, View::MapView *view0, const std::shared_ptr<const Model::Map> &map0);
+ MapContext(EventBus *eventBus0, InputHandler *inputHandler0, const std::shared_ptr<View::Window> &window, const Model::Map &map0);
void render(uint64_t time) {
- view->render(entities, getViewPosition(time), time);
+ view->render(&map, getViewPosition(time), time);
}
};