Table of Contents

Method GetConnectedSet

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

GetConnectedSet<TPoint>(IExplicitShape<TPoint>, TPoint, Func<TPoint, IEnumerable<TPoint>>)

Gets the largest connected set in the grid from the given point.

public static HashSet<TPoint> GetConnectedSet<TPoint>(IExplicitShape<TPoint> grid, TPoint point, Func<TPoint, IEnumerable<TPoint>> getConnectedPoints)

Parameters

grid IExplicitShape<TPoint>

The grid from which to get the connected set.

point TPoint

Point where the check start.

getConnectedPoints Func<TPoint, IEnumerable<TPoint>>

This function is used to get the connected Points.

Returns

HashSet<TPoint>

Returns a list of points connected to the given point.

Type Parameters

TPoint

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