diff options
Diffstat (limited to 'src/control/MapContext.hpp')
-rw-r--r-- | src/control/MapContext.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/control/MapContext.hpp b/src/control/MapContext.hpp index 37a38ea..a9481a6 100644 --- a/src/control/MapContext.hpp +++ b/src/control/MapContext.hpp @@ -44,19 +44,26 @@ private: EventBus *const eventBus; InputHandler *const inputHandler; + View::MapView *const view; + std::shared_ptr<const Model::Map> map; - uint64_t totalTicks = 0; + std::vector<std::unique_ptr<Model::Entity>> entities; + Model::Entity *playerEntity; void movePlayer(Model::Direction dir, uint64_t time); void movePlayerContinue(uint64_t time); void keyPressed(uint16_t key, uint64_t time); + Model::Position getViewPosition(uint64_t time) { + return playerEntity->getPosition(time); + } + public: - MapContext(EventBus *eventBus0, InputHandler *inputHandler0, const std::shared_ptr<const Model::Map> &map0); + MapContext(EventBus *eventBus0, InputHandler *inputHandler0, View::MapView *view0, const std::shared_ptr<const Model::Map> &map0); - Model::Position getViewPosition(uint64_t time) { - return map->getPlayerEntity()->getPosition(time); + void render(uint64_t time) { + view->render(entities, getViewPosition(time), time); } }; |