forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iuse_software_sokoban.h
59 lines (49 loc) · 1.49 KB
/
iuse_software_sokoban.h
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
51
52
53
54
55
56
57
58
59
#pragma once
#ifndef CATA_SRC_IUSE_SOFTWARE_SOKOBAN_H
#define CATA_SRC_IUSE_SOFTWARE_SOKOBAN_H
#include <cstddef>
#include <iosfwd>
#include <map>
#include <utility>
#include <vector>
#include "point.h"
namespace catacurses
{
class window;
} // namespace catacurses
class sokoban_game
{
private:
class cUndo
{
public:
point old;
std::string sTileOld;
cUndo() {
old = point_zero;
sTileOld = " ";
}
cUndo( const point &arg, const std::string &arg_tile ) {
old = arg;
sTileOld = arg_tile;
}
};
int iCurrentLevel = 0;
int iNumLevel = 0;
int iTotalMoves = 0;
std::map<int, std::map<int, std::string> > mLevel;
std::map<int, std::map<std::string, size_t> > mLevelInfo;
std::vector<std::map<int, std::map<int, std::string> > > vLevel;
std::vector<cUndo> vUndo;
std::vector<std::vector<std::pair<int, int> > > vLevelDone;
std::map<int, bool> mAlreadyWon;
void parse_level( std::istream &fin );
bool check_win();
int get_wall_connection( const point & );
void draw_level( const catacurses::window &w_sokoban );
void print_score( const catacurses::window &w_sokoban, int iScore, int iMoves );
public:
int start_game();
sokoban_game();
};
#endif // CATA_SRC_IUSE_SOFTWARE_SOKOBAN_H