#ifndef PUZZLE_HPP_SENTRY #define PUZZLE_HPP_SENTRY #include #include #include #include #include enum { puzzle_pieces = 8, puzzles_per_side = 3, puzzle_size = 100, spacing = 5 }; class Puzzle : Fl_Button{ unsigned char sequence_number; std::string path; Puzzle(int x, int y) : Fl_Button(x, y, puzzle_size, puzzle_size) {} friend class GameParams; }; class GameParams { public: struct coordinates { int x, y; }; private: coordinates standard_puzzle_coordinates[puzzle_pieces]; char free_puzzles[puzzle_pieces]; coordinates empty_box; std::vector> puzzles; GameParams() {} void CalculateStandardPuzzlePos(); void ResetFreePuzzles(); void CreateNewPuzzles(); public: void NewGame(); void SetXYEmptyBox(int x, int y) { empty_box.x = x; empty_box. y = y; } coordinates GetXYEmptyBox() { return empty_box; } static GameParams *SetUpParams() { GameParams *gi = new GameParams; gi->CalculateStandardPuzzlePos(); return gi; } }; #endif