Advertisement
Dijuna

memory

Jan 10th, 2017
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool PuzzleArea::hasPathToCenter(PuzzleArea *test, PuzzleArea *ignore)
  2. {
  3.     if (test != Q_NULLPTR) {
  4.         for (PuzzleArea *n : test->neighbours) {
  5.             if (n != Q_NULLPTR) {
  6.                 if (n->isCentral()) {
  7.                     return true;
  8.                 }
  9.                 if (n->isPuzzle() && ignore != n) {
  10.                     if (hasPathToCenter(n, ignore)) {
  11.                         return true;
  12.                     }
  13.                 }
  14.             }
  15.         }
  16.     }
  17.     return false;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement