Method GetLongestConnectedRay
GetLongestConnectedRay<TPoint>(IImplicitShape<TPoint>, TPoint, IEnumerable<IForwardMap<TPoint, TPoint>>, Func<TPoint, TPoint, bool>)
Gets the longest of the rays connected to this cell. GetConnectedRays<TPoint>(IImplicitShape<TPoint>, TPoint, IEnumerable<IForwardMap<TPoint, TPoint>>, Func<TPoint, TPoint, bool>)
public static IEnumerable<TPoint> GetLongestConnectedRay<TPoint>(IImplicitShape<TPoint> grid, TPoint point, IEnumerable<IForwardMap<TPoint, TPoint>> rayMaps, Func<TPoint, TPoint, bool> isNeighborsConnected)
Parameters
gridIImplicitShape<TPoint>Grid in which the calculations are made.
pointTPointPoint where the calculations start.
rayMapsIEnumerable<IForwardMap<TPoint, TPoint>>List of maps that can generate rays iteratively.
isNeighborsConnectedFunc<TPoint, TPoint, bool>A functions that returns true or false, depending on whether two points can be considered connected when they are neighbors.For example, if you want rays of points that refer to cells of the same color, you can pass in a functions that compares the DefaultColors of cells.
Returns
- IEnumerable<TPoint>
Type Parameters
TPointThe type of point of the grid that this algorithm takes.