Method GetConnectedLines
GetConnectedLines<TPoint>(IImplicitShape<TPoint>, TPoint, IEnumerable<IMap<TPoint, TPoint>>, Func<TPoint, TPoint, bool>)
Gets the longest line of connected points that contains this point. GetConnectedRays<TPoint>(IImplicitShape<TPoint>, TPoint, IEnumerable<IForwardMap<TPoint, TPoint>>, Func<TPoint, TPoint, bool>)
public static IEnumerable<IEnumerable<TPoint>> GetConnectedLines<TPoint>(IImplicitShape<TPoint> grid, TPoint point, IEnumerable<IMap<TPoint, TPoint>> lineMaps, Func<TPoint, TPoint, bool> isNeighborsConnected)
Parameters
gridIImplicitShape<TPoint>Grid in which the calculations are made.
pointTPointPoint where the calculations start.
lineMapsIEnumerable<IMap<TPoint, TPoint>>List of maps that can generate lines 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<IEnumerable<TPoint>>
Type Parameters
TPointThe type of point of the grid that this algorithm takes.