Took the plunge and converted my 'shaperators' into templates so they'll work on any 'matrix-like' thing.
This commit is contained in:
parent
5adeb4e078
commit
4cb41a61db
5 changed files with 182 additions and 192 deletions
|
@ -6,7 +6,7 @@
|
|||
using std::vector;
|
||||
|
||||
inline void add_neighbors(PointList &neighbors, Matrix &closed, size_t y, size_t x) {
|
||||
for(matrix::in_box it{closed, x, y, 1}; it.next();) {
|
||||
for(matrix::box it{closed, x, y, 1}; it.next();) {
|
||||
if(closed[it.y][it.x] == 0) {
|
||||
closed[it.y][it.x] = 1;
|
||||
neighbors.push_back({.x=it.x, .y=it.y});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue