diff options
Diffstat (limited to 'src/control/MapContext.hpp')
-rw-r--r-- | src/control/MapContext.hpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/control/MapContext.hpp b/src/control/MapContext.hpp index 26f7e34..446ca10 100644 --- a/src/control/MapContext.hpp +++ b/src/control/MapContext.hpp @@ -26,6 +26,7 @@ #pragma once +#include "EventBus.hpp" #include "ImageLoader.hpp" #include "InputHandler.hpp" #include "../model/Map.hpp" @@ -41,6 +42,8 @@ namespace Control { class MapContext { private: + EventBus *const eventBus; + InputHandler *const inputHandler; ImageLoader *const imageLoader; std::shared_ptr<const Model::Map> map; @@ -50,13 +53,15 @@ private: uint64_t totalTicks = 0; -public: - MapContext(ImageLoader *imageLoader0, const std::shared_ptr<const Model::Map> &map0); + void movePlayer(Model::Direction dir, uint64_t time); + void movePlayerContinue(uint64_t time); + void keyPressed(uint16_t key, uint64_t time); - void advance(InputHandler *inputHandler, unsigned ticks); +public: + MapContext(EventBus *eventBus0, InputHandler *inputHandler0, ImageLoader *imageLoader0, const std::shared_ptr<const Model::Map> &map0); - Model::Position getViewPosition() { - return map->getPlayerEntity().getPosition(); + Model::Position getViewPosition(uint64_t time) { + return map->getPlayerEntity()->getPosition(time); } std::shared_ptr<View::MapView> initView(const std::shared_ptr<View::Window> &window) { |