void Face::tryGoUp(queue<Vertex> &queue, Vertex &v) { Vertex next = v; switch(orientation) { case zFace: y(next)++; if(squares.count(next)) return; if(crossesBorder(v, next, upDir)) return; break; case xFace: case yFace: z(next)++; if(squares.count(next)) return; if(crossesBorder(v, next, frontDir)) return; break; } squares.insert(next); queue.push(next); }
void Face::tryGoLeft(queue<Vertex> &queue, Vertex &v) { Vertex next = v; switch(orientation) { case zFace: case yFace: x(next)--; if(squares.count(next)) return; if(crossesBorder(v, next, leftDir)) return; break; case xFace: y(next)--; if(squares.count(next)) return; if(crossesBorder(v, next, downDir)) return; break; } squares.insert(next); queue.push(next); }
void tryGoUp(queue<Vertex> &queue, Vertex v) { y(v)++; if(borderSquares[yFace]->count(v)) return; if(blocks.count(v)) return; blocks.insert(v); queue.push(v); }
void tryGoDown(queue<Vertex> &queue, Vertex v) { if(borderSquares[yFace]->count(v)) return; y(v)--; if(blocks.count(v)) return; blocks.insert(v); queue.push(v); }