Ejemplo n.º 1
0
 private static IEnumerable <MoveDirection> ConvertPointsToDirections(List <Point> points)
 {
     return(points.Zip(points.Skip(1), (p1, p2) =>
                       Walker.ConvertOffsetToDirection(new Size(p2.X - p1.X, p2.Y - p1.Y))));
 }
Ejemplo n.º 2
0
 private static MoveDirection[] ConvertPathToDirection(List <Point> pathList)
 {
     return(pathList.Zip(pathList.Skip(1), (current, next) => Walker.ConvertOffsetToDirection(new Size(next) - new Size(current))).ToArray());
 }
Ejemplo n.º 3
0
 private static IEnumerable <MoveDirection> PathConvertToMoveDirection(List <Point> path) =>
 path.Zip(path.Skip(1),
          (a, b) => Walker.ConvertOffsetToDirection(new Size(b) - new Size(a)));
Ejemplo n.º 4
0
 public static IEnumerable <MoveDirection> AsPathWalk(this Steps steps) =>
 steps.Zip(steps.Skip(1),
           (a, b) => Walker.ConvertOffsetToDirection(new Size(b) - new Size(a)));