public virtual void Init(Puzzle puzzle) { if (puzzle == null) throw new ArgumentNullException("puzzle"); Statistics = new Statistics() { Started = DateTime.Now }; Start = Current = puzzle; Analysis = new PuzzleAnalysis(Start); PuzzleStack.Clear(); PuzzleStack.Push(puzzle); InitElements(); var name = "unnamed"; var lp = puzzle as LibraryPuzzle; if (lp != null && lp.Details != null && !string.IsNullOrWhiteSpace(lp.Details.Name)) { name = lp.Details.Name; } Console.WriteLine("You are taking on the '{0}' puzzle.", name); }
public SokobanGameLogic() { PuzzleStack = new Stack<Puzzle>(); MoveStack = new Stack<VectorInt2>(); Statistics = new Statistics(); }