A bit of late night work designing the little iterators.

This commit is contained in:
Zed A. Shaw 2024-12-14 11:00:52 -05:00
parent da0b941dfd
commit 8e470df554
11 changed files with 115 additions and 235 deletions

View file

@ -131,12 +131,8 @@ void WorldBuilder::generate() {
$map.$walls[hole.y][hole.x] = INV_SPACE;
}
// invert the whole map to finish it
for(size_t y = 0; y < $map.$height; ++y) {
for(size_t x = 0; x < $map.$width; ++x) {
// invert the map
$map.$walls[y][x] = !$map.$walls[y][x];
}
for(matrix::each_cell it{$map.$walls}; it.next();) {
$map.$walls[it.y][it.x] = !$map.$walls[it.y][it.x];
}
}