Conver to using \ for member variables in classes. In structs just use the name.
This commit is contained in:
parent
187edb898e
commit
5cf66aad02
8 changed files with 143 additions and 144 deletions
30
map.hpp
30
map.hpp
|
@ -34,17 +34,17 @@ void dump_map(const std::string &msg, Matrix &map);
|
|||
void add_neighbors(Matrix &closed, size_t j, size_t i);
|
||||
|
||||
class Map {
|
||||
Matrix input_map_;
|
||||
Matrix walls_;
|
||||
Matrix paths_;
|
||||
std::vector<Room> rooms_;
|
||||
int limit_ = 0;
|
||||
Matrix $input_map;
|
||||
Matrix $walls;
|
||||
Matrix $paths;
|
||||
std::vector<Room> $rooms;
|
||||
int $limit = 0;
|
||||
public:
|
||||
|
||||
// make explicit
|
||||
Map(Matrix input_map, Matrix walls_map, int limit) :
|
||||
input_map_(input_map),
|
||||
walls_(walls_map), limit_(limit) {
|
||||
$input_map(input_map),
|
||||
$walls(walls_map), $limit(limit) {
|
||||
}
|
||||
|
||||
// make random
|
||||
|
@ -53,18 +53,18 @@ public:
|
|||
// disable copying
|
||||
Map(Map &map) = delete;
|
||||
|
||||
Matrix& paths() { return paths_; }
|
||||
Matrix& input_map() { return input_map_; }
|
||||
Matrix& walls() { return walls_; }
|
||||
int limit() { return limit_; }
|
||||
size_t width() { return walls_[0].size(); }
|
||||
size_t height() { return walls_.size(); }
|
||||
Matrix& paths() { return $paths; }
|
||||
Matrix& input_map() { return $input_map; }
|
||||
Matrix& walls() { return $walls; }
|
||||
int limit() { return $limit; }
|
||||
size_t width() { return $walls[0].size(); }
|
||||
size_t height() { return $walls.size(); }
|
||||
Room &room(size_t at) {
|
||||
return rooms_[at];
|
||||
return $rooms[at];
|
||||
}
|
||||
|
||||
size_t room_count() {
|
||||
return rooms_.size();
|
||||
return $rooms.size();
|
||||
}
|
||||
|
||||
void make_room(size_t origin_y, size_t origin_x, size_t width, size_t height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue