public virtual void Reset() { Statistics.Restarts++; Current = Start; PuzzleStack.Clear(); }
public virtual void Init(Puzzle puzzle) { if (puzzle == null) { throw new ArgumentNullException("puzzle"); } Start = Current = puzzle; PuzzleStack.Clear(); PuzzleStack.Push(puzzle); }
public virtual bool UndoMove() { if (PuzzleStack.Count < 2) { return(false); } Statistics.Undos++; PuzzleStack.Pop(); // Discard top Current = PuzzleStack.Peek(); return(true); }
public virtual void Init() { PuzzleStack.Clear(); PuzzleStack.Push(Start); }
private void UpdateState(Map newState) { PuzzleStack.Push(newState); Current = newState; }