-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.h
53 lines (41 loc) · 830 Bytes
/
map.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
#ifndef _MAP_
#define _MAP_
/**
* Map is a rectangle object with given width and height
*
* Each field could be a different type
*/
#ifdef DEBUG
#include <iostream>
#endif
const unsigned int WIDTH = 30;
const unsigned int HEIGHT = 10;
namespace map {
/**
* Type of map field
*/
enum MapType {
FLOOR,
WALL,
OBJECT
};
class Map {
unsigned int width;
unsigned int height;
MapType type;
protected:
MapType** field;
public:
Map();
~Map();
unsigned int getWidth() const { return width; }
unsigned int getHeight() const { return height; }
MapType getType(unsigned const i, unsigned const j) const;
void init();
virtual void fill(); /// this determines the way the map is created
#ifdef DEBUG
friend std::ostream & operator<<(std::ostream& os, const Map& m);
#endif
};
};
#endif