-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyMap.hh
81 lines (69 loc) · 1.76 KB
/
MyMap.hh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// MyMap.hh for MyMap in /home/nerevarine/Documents/bomberman-2015-tolsa_c
//
// Made by nerevarine
// Login <nerevarine@scarlett>
//
// Started on Mon May 28 21:57:52 2012 nerevarine
// Last update Sun Jun 3 15:58:29 2012 nerevarine
//
#ifndef _MYMAP_HH_
#define _MYMAP_HH_
#include "./BombermanCommon.hh"
#include "./Bloc.hh"
#include "./Wall.hh"
#include "./Box.hh"
#include "./Ground.hh"
#include "./Bonus.hh"
#include "./Burn.hh"
#include "./Bomb.hh"
#define C_WALL 'W'
#define C_BOX 'B'
#define C_GROUND '.'
#define C_BOMB 'X'
#define C_BONUS_P 'P'
#define C_BONUS_S 'S'
#define C_BONUS_B 'O'
class MyMap
{
private:
int x;
int y;
Bloc ***map;
gdl::Image Wall_;
gdl::Image Box_;
gdl::Image Ground1_;
gdl::Image Ground2_;
gdl::Image BonusBombNb_;
gdl::Image BonusSpeedAdd_;
gdl::Image BonusPortee_;
gdl::Image Explosion_;
std::deque<std::string> mapsFile;
std::deque<Vector2d> lstPlace;
public:
MyMap();
~MyMap();
int getX() const;
int getY() const;
Bloc ***getMap() const;
void setX(int x);
void setY(int y);
void setMap(Bloc ***m);
void loadMap(std::string const&);
void setAt(Bloc*, int const&, int const&);
Bloc *getAt(int, int) const;
void initialize();
void initialize(int const&, int const&);
void initialize(std::string const&);
bool checkArea(Vector2d a[8]);
bool getArea(int, int);
//GAME
void generateMap();
void generateMap(int const &, int const &);
std::deque<Vector2d> getPlace() const;
void drawBonus(Bloc *bonus);
void draw();
};
std::istream& operator>>(std::istream& is, MyMap &m);
std::ostream& operator<<(std::ostream& os, const MyMap &m);
#endif /* !_MYMAP_HH_ */