#include <puzzle.h>
Public Member Functions | |
PuzzleGame (const char *dump=0) | |
Constructor. | |
PuzzleGame (unsigned int givens_count, bool symmetric=true) | |
Constructor with generation of a random puzzle. | |
virtual | ~PuzzleGame () |
Destructor. | |
virtual void | reset () |
Reset the puzzle (including marks). | |
virtual void | reset (bool clear_marks) |
Reset the puzzle (either with or without marks). | |
virtual void | set_with_history (unsigned int number) |
Set the number into the current cell, write action into history. | |
Pos | get_pos () const |
Get the position of the current cell. | |
void | set_pos (Pos new_pos) |
Set the position of the current cell. | |
void | backward () |
Go one step backward in the history. | |
void | forward () |
Go one step forward in the history. | |
Private Member Functions | |
PuzzleGame (const PuzzleGame &other) | |
PuzzleGame & | operator= (const PuzzleGame &other) |
Private Attributes | |
Pos | pos |
History * | history |
Sudoku puzzle game.
Definition at line 215 of file puzzle.h.
Sudoku::PuzzleGame::PuzzleGame | ( | const PuzzleGame & | other | ) | [private] |
PuzzleGame::PuzzleGame | ( | const char * | dump = 0 |
) |
PuzzleGame::PuzzleGame | ( | unsigned int | givens_count, | |
bool | symmetric = true | |||
) |
Constructor with generation of a random puzzle.
Definition at line 396 of file puzzle.cpp.
References history.
PuzzleGame::~PuzzleGame | ( | ) | [virtual] |
void PuzzleGame::backward | ( | ) |
Go one step backward in the history.
Definition at line 447 of file puzzle.cpp.
References Sudoku::History::backward(), Sudoku::History::current(), history, Sudoku::History::movesExecuted(), and Sudoku::Move::takeBack().
Referenced by SudokuPlugin::Menu::undo().
void PuzzleGame::forward | ( | ) |
Go one step forward in the history.
Definition at line 457 of file puzzle.cpp.
References Sudoku::History::current(), Sudoku::Move::execute(), Sudoku::History::forward(), history, and Sudoku::History::movesToExecute().
Referenced by SudokuPlugin::Menu::redo().
Pos PuzzleGame::get_pos | ( | ) | const |
Get the position of the current cell.
Definition at line 435 of file puzzle.cpp.
References pos.
Referenced by SudokuPlugin::Menu::next_cell(), SudokuPlugin::Menu::next_number(), SudokuPlugin::Menu::paint(), SudokuPlugin::Menu::ProcessKey(), Sudoku::SetMove::SetMove(), Test_History::test_SetMove(), and SudokuPlugin::Menu::toggle_mark().
PuzzleGame& Sudoku::PuzzleGame::operator= | ( | const PuzzleGame & | other | ) | [private] |
void PuzzleGame::reset | ( | bool | clear_marks | ) | [virtual] |
Reset the puzzle (either with or without marks).
Reimplemented from Sudoku::Puzzle.
Definition at line 415 of file puzzle.cpp.
References history, Sudoku::History::reset(), and reset().
void PuzzleGame::reset | ( | ) | [virtual] |
Reset the puzzle (including marks).
Reimplemented from Sudoku::Puzzle.
Definition at line 409 of file puzzle.cpp.
Referenced by reset(), and SudokuPlugin::Menu::reset().
void PuzzleGame::set_pos | ( | Pos | new_pos | ) |
Set the position of the current cell.
Definition at line 441 of file puzzle.cpp.
References pos.
Referenced by Sudoku::SetMove::execute(), SudokuPlugin::Menu::next_cell(), SudokuPlugin::Menu::ProcessKey(), and Sudoku::SetMove::takeBack().
void PuzzleGame::set_with_history | ( | unsigned int | number | ) | [virtual] |
Set the number into the current cell, write action into history.
Definition at line 423 of file puzzle.cpp.
References Sudoku::History::add(), Sudoku::History::current(), Sudoku::Move::execute(), Sudoku::Puzzle::given(), history, and pos.
Referenced by SudokuPlugin::Menu::next_number(), and SudokuPlugin::Menu::ProcessKey().
History* Sudoku::PuzzleGame::history [private] |
Definition at line 218 of file puzzle.h.
Referenced by backward(), forward(), PuzzleGame(), reset(), set_with_history(), and ~PuzzleGame().
Pos Sudoku::PuzzleGame::pos [private] |
Definition at line 217 of file puzzle.h.
Referenced by get_pos(), set_pos(), and set_with_history().