public Path PathWithNewCoordsAndDirection(Coords newCoords, Direction direction, int maxDirectionChanges) { var isActive = PathUtils.IsActiveWithNewCoords(this, newCoords, direction, maxDirectionChanges); var newNumDirectionChanges = NumDirectionChanges + (direction != Direction ? 1 : 0); return(new Path(CoordsList.Concat(new[] { newCoords }).ToArray(), direction, newNumDirectionChanges, isActive)); }
public Path PathWithEndCoords(Coords endCoords) { return(new Path(CoordsList.Concat(new[] { endCoords }).ToArray(), Direction, NumDirectionChanges, true)); }