-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sokoban.hpp
50 lines (37 loc) · 1.06 KB
/
Sokoban.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright[2023]<Copyright Arthea Valderrama>
#pragma once
#include <vector>
#include <string>
#include <memory>
#include <algorithm>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include "matrix.hpp"
enum class Move { UP, LEFT, DOWN, RIGHT};
class Sokoban : public sf::Drawable {
public:
Sokoban();
size_t getWindowx();
size_t getWindowy();
bool isWon() const;
bool movePlayer(Move choice);
void reset();
friend std::istream & operator>>(std::istream &o, Sokoban& soko);
friend std::ostream & operator<<(std::ostream &o, const Sokoban& soko);
private:
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
sf::Texture player;
sf::Texture crate;
sf::Texture targetarea;
sf::Texture ground;
sf::Texture wall;
sf::Texture victory;
sf::Vector2u _player;
std::vector<sf::Vector2u> _targetarea;
std::vector<sf::Vector2u> _crate;
std::unique_ptr<Matrix> matrix;
std::unique_ptr<Matrix> _matrix;
Move move;
};