-
Notifications
You must be signed in to change notification settings - Fork 0
/
map3.h
59 lines (43 loc) · 1.11 KB
/
map3.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
54
55
56
57
58
59
/*!
* @file map3.h v1.0
* @Copyright © 2018 Kazushi Kurasawa
* @date 2018.11.16
*
* Released under the MIT license.
* see https://opensource.org/licenses/MIT
*/
#ifndef NEWZUZUMOUSE_MAP_3_H
#define NEWZUZUMOUSE_MAP_3_H
#include "block.h"
#include "deftype.h"
#include "point.h"
class Map3 {
public:
Map3(uint8_t x_size, uint8_t y_size);
Map3(const Map3& _m){
Map3(_m._x_size, _m._y_size);
for (int i = 0; i < _x_size; ++i) {
for (int j = 0; j < _y_size; ++j) {
_block[i][j] = _m._block[i][j];
}
}
}
~Map3();
/* マップの壁情報とかセット */
void set_block(Block block, Point<uint8_t> point);
/* 歩数情報をセット */
void set_walk_cnt(Point<uint8_t> point, int walk_cnt){
_block[point.x][point.y].walk_cnt = walk_cnt;
}
Block& at(Point<uint8_t> point);
Point<uint8_t> size(){
return Point<uint8_t >(_x_size, _y_size);
}
protected:
Block **_block;
uint8_t _x_size = 0;
uint8_t _y_size = 0;
Point <uint8_t>_point;
void map_init();
};
#endif //NEWZUZUMOUSE_MAP_3_H