blob: 83244f3a2a8041aa104ca35a8997c924255c8ccd (
plain) (
blame)
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
|
#ifndef MAP_H
#define MAP_H
#include <string>
#include <exception>
const int TILE_WIDTH = 8;
const int TILE_HEIGHT = 8;
const int GAME_WIDTH = 320;
const int GAME_HEIGHT = 200;
const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH;
const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT - 1;
class MapLoadException: public std::exception
{
public:
MapLoadException(std::string mapname) : mapname(mapname) {}
virtual const char* what() const throw()
{
return ("An error occured loading map " + mapname).c_str();
}
private:
std::string mapname;
};
class Map {
public:
Map();
Map(const std::string name);
Map(const Map& map);
Map(Map&& map);
~Map();
Map& operator= (Map other);
friend void swap(Map& first, Map& second);
int* mapdata;
std::string title;
std::string leftmap;
std::string rightmap;
};
#endif
|