diff options
Diffstat (limited to 'tools/mapedit/src/map.h')
-rw-r--r-- | tools/mapedit/src/map.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/mapedit/src/map.h b/tools/mapedit/src/map.h new file mode 100644 index 0000000..83244f3 --- /dev/null +++ b/tools/mapedit/src/map.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef MAP_H | ||
2 | #define MAP_H | ||
3 | |||
4 | #include <string> | ||
5 | #include <exception> | ||
6 | |||
7 | const int TILE_WIDTH = 8; | ||
8 | const int TILE_HEIGHT = 8; | ||
9 | const int GAME_WIDTH = 320; | ||
10 | const int GAME_HEIGHT = 200; | ||
11 | const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH; | ||
12 | const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT - 1; | ||
13 | |||
14 | class MapLoadException: public std::exception | ||
15 | { | ||
16 | public: | ||
17 | MapLoadException(std::string mapname) : mapname(mapname) {} | ||
18 | |||
19 | virtual const char* what() const throw() | ||
20 | { | ||
21 | return ("An error occured loading map " + mapname).c_str(); | ||
22 | } | ||
23 | |||
24 | private: | ||
25 | std::string mapname; | ||
26 | }; | ||
27 | |||
28 | class Map { | ||
29 | public: | ||
30 | Map(); | ||
31 | Map(const std::string name); | ||
32 | Map(const Map& map); | ||
33 | Map(Map&& map); | ||
34 | ~Map(); | ||
35 | Map& operator= (Map other); | ||
36 | friend void swap(Map& first, Map& second); | ||
37 | |||
38 | int* mapdata; | ||
39 | std::string title; | ||
40 | std::string leftmap; | ||
41 | std::string rightmap; | ||
42 | }; | ||
43 | |||
44 | #endif | ||