Table of Contents

Method GetLongestConnectedRay

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

GetLongestConnectedRay<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

grid IImplicitShape<TPoint>

Grid in which the calculations are made.

point TPoint

Point where the calculations start.

rayMaps IEnumerable<IForwardMap<TPoint, TPoint>>

List of maps that can generate rays iteratively.

isNeighborsConnected Func<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

TPoint

The type of point of the grid that this algorithm takes.