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)))); }
private static MoveDirection[] ConvertPathToDirection(List <Point> pathList) { return(pathList.Zip(pathList.Skip(1), (current, next) => Walker.ConvertOffsetToDirection(new Size(next) - new Size(current))).ToArray()); }
private static IEnumerable <MoveDirection> PathConvertToMoveDirection(List <Point> path) => path.Zip(path.Skip(1), (a, b) => Walker.ConvertOffsetToDirection(new Size(b) - new Size(a)));
public static IEnumerable <MoveDirection> AsPathWalk(this Steps steps) => steps.Zip(steps.Skip(1), (a, b) => Walker.ConvertOffsetToDirection(new Size(b) - new Size(a)));