diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/game.hpp | 7 | ||||
| -rw-r--r-- | include/graphics.hpp | 5 |
2 files changed, 11 insertions, 1 deletions
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 <iostream> +#include <fstream> #include <string> #include <vector> #include <algorithm> @@ -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<Position> m_cratePos; std::vector<Position> 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); }; diff --git a/include/graphics.hpp b/include/graphics.hpp index ea5d70e..5f274a3 100644 --- a/include/graphics.hpp +++ b/include/graphics.hpp @@ -28,7 +28,10 @@ private: SDL_Texture *m_crateTex; SDL_Texture *m_crateSolvedTex; SDL_Texture *m_payloadTex; - SDL_Texture *m_playerTex; + SDL_Texture *m_playerUpTex; + SDL_Texture *m_playerDownTex; + SDL_Texture *m_playerLeftTex; + SDL_Texture *m_playerRightTex; void drawGame(); void drawCell(Game::Cell cell, int y, int x); |
