back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--puzzle.hpp9
-rw-r--r--solution_algorithm.hpp4
2 files changed, 6 insertions, 7 deletions
diff --git a/puzzle.hpp b/puzzle.hpp
index 6e8d666..09660c8 100644
--- a/puzzle.hpp
+++ b/puzzle.hpp
@@ -58,11 +58,6 @@ private:
void CreateNewPuzzles();
void SelectRandomPicture();
Fl_PNG_Image *LoadPictureParts(std::unique_ptr<Puzzle>& tmp_puzzle);
-
- friend class PuzzleGame;
- friend class ASearch;
- friend void press_button_callback(Fl_Widget*, void*);
- friend void solve_problem_callback(Fl_Widget*, void*);
public:
void SetXYEmptyBox(int x, int y) { empty_box.x = x; empty_box. y = y; }
coordinates GetXYEmptyBox() { return empty_box; }
@@ -73,6 +68,10 @@ public:
gi->CalculateStandardPuzzlePos();
return gi;
}
+ friend class PuzzleGame;
+ friend class ASearch;
+ friend void press_button_callback(Fl_Widget*, void*);
+ friend void solve_problem_callback(Fl_Widget*, void*);
};
#endif
diff --git a/solution_algorithm.hpp b/solution_algorithm.hpp
index 440264b..f182aa8 100644
--- a/solution_algorithm.hpp
+++ b/solution_algorithm.hpp
@@ -16,8 +16,6 @@ private:
Node *parent_p;
int depth;
int evaluation;
- friend struct std::hash<std::shared_ptr<Node>>;
- friend class ASearch;
public:
Node(std::vector<GameParams::coordinates>& s, Node *p = nullptr,
int d = 0, int e = 0)
@@ -30,6 +28,8 @@ public:
return first->evaluation > second->evaluation;
}
};
+ friend struct std::hash<std::shared_ptr<Node>>;
+ friend class ASearch;
};
template<>