public void Regression1() { var report = new TestReport(); var defaultPuzzle = new Puzzle(); // default puzzle var analysis = new PuzzleAnalysis(defaultPuzzle); var state = analysis.Evalute(defaultPuzzle); var pushMap = PushMap.Find(state, new VectorInt2(3,3), defaultPuzzle.Player.Position); report.WriteLine("==================="); report.WriteLine(defaultPuzzle); report.WriteLine(pushMap); report.WriteLine("==================="); var r = pushMap.FindPlayerWalkRoute(new VectorInt2(7, 3)); report.WriteLine(r); Assert.That(report, Is.EqualTo(new TestReport( @"=================== #~~###~~~~# ~~##.#~#### ~##..###..# ##.X......# #...PX.#..# ###.X###..# ~~#..#OO..# ~##.##O#.## ~#......##~ ~#.....##~~ ########~~~ ........... ....X...... ...XX...XX. ..XXXXXXXX. .XXXX...XX. ...X....XX. ...X..XXXX. ...X..X.X.. ..XXXXXX... ..XXXXX.... ........... =================== LLURRRR " ))); }
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); }