public bool EveryPointHasDirection(IMazeJumper maze) { var results = _mazeHelper.GetForEachPoint <CellValidationResult>(maze.Size, x => GetResult(maze, x)).ToList(); var validationFailures = results.Where(x => x.Flag == Direction.None).ToList(); if (!validationFailures.Any()) { return(true); } //var first = validationFailures.First(); return(false); }
private IEnumerable <PointAndDirections> GetPointsWithDirections(IMazeCarver carver) { return(_mazeHelper.GetForEachPoint(carver.Size, point => { carver.JumpToPoint(point); return new PointAndDirections { Point = point, Directions = carver.GetsDirectionsFromPoint().ToList() }; })); }