Example #1
0
        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);
        }
Example #2
0
 private IEnumerable <PointAndDirections> GetPointsWithDirections(IMazeCarver carver)
 {
     return(_mazeHelper.GetForEachPoint(carver.Size, point =>
     {
         carver.JumpToPoint(point);
         return new PointAndDirections
         {
             Point = point,
             Directions = carver.GetsDirectionsFromPoint().ToList()
         };
     }));
 }