-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.hpp
50 lines (36 loc) · 900 Bytes
/
map.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
#ifndef _CPROG_MAP_HPP_
#define _CPROG_MAP_HPP_
#include <vector>
#include <string>
#include "tile.hpp"
#include "position.hpp"
#include <memory>
#include <cstdlib>
namespace cprogame{
class Game; //forward reference
class Map{
std::vector<std::string> meta_door;
std::vector<std::shared_ptr<Door> > doors;
Position player_pos;
Game * game_ptr;
public:
std::vector<std::vector<std::shared_ptr<Tile> > > tiles;
/**
* Default constructor
*/
Map(Game * _game_ptr);
/**
* Loads map from file.
*/
void load(const std::string &);
/**
* Renders the map to screen
*/
void print() const;
std::shared_ptr<Tile> get_tile(const unsigned int &, const unsigned int &) const;
const Door & get_door(const unsigned int &, const unsigned int &) const;
std::vector<std::shared_ptr<Door> > & get_doors();
Position get_player_pos();
}; // class Map
} // namespace cprogame
#endif