From caeb26e90ef09fdad85af72f460644e09d3b2c7c Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 21 Mar 2020 16:12:16 +0100 Subject: Player sprite direction, read map file --- include/game.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/game.hpp') diff --git a/include/game.hpp b/include/game.hpp index 647a12d..946f07c 100644 --- a/include/game.hpp +++ b/include/game.hpp @@ -1,6 +1,8 @@ #ifndef GAME_HPP # define GAME_HPP +#include +#include #include #include #include @@ -9,6 +11,7 @@ class Game { public: Game(std::string fmt); + Game(std::ifstream &file); ~Game(); enum Direction @@ -40,6 +43,7 @@ public: size_t getHeight() const; size_t getWidth() const; Position const &getPlayer() const; + Direction getPlayerDirection() const; private: @@ -51,8 +55,11 @@ private: std::vector m_cratePos; std::vector m_payloadPos; + void construct(std::string fmt); + void findWidth(std::string fmt); bool tryMoveCrate(Position &pos, Direction direction); bool validPosition(Position pos); + static Position makePos(int y, int x); }; -- cgit