Class ClosestConnectionPointSelector
Implements a the selection algorithm that selects the two points closest to each other in the given Area instances.
Implements
Inherited Members
Namespace: GoRogue.MapGeneration.ConnectionPointSelectors
Assembly: GoRogue.dll
Syntax
public class ClosestConnectionPointSelector : IConnectionPointSelector
Constructors
View SourceClosestConnectionPointSelector(Distance)
Creates a new point selector.
Declaration
public ClosestConnectionPointSelector(Distance distanceCalculation)
Parameters
Type | Name | Description |
---|---|---|
Distance | distanceCalculation | Distance calculation to use to determine closeness. |
Fields
View SourceDistanceCalculation
Distance calculation to use to determine closeness.
Declaration
public readonly Distance DistanceCalculation
Field Value
Type | Description |
---|---|
Distance |
Methods
View SourceSelectConnectionPoints(IReadOnlyArea, IReadOnlyArea)
Implements the algorithm. Returns pair of positions -- one position in area1
to use, and on position in area2
to use.
Declaration
public AreaConnectionPointPair SelectConnectionPoints(IReadOnlyArea area1, IReadOnlyArea area2)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyArea | area1 | First Area to connect. |
IReadOnlyArea | area2 | Second Area to connect. |
Returns
Type | Description |
---|---|
AreaConnectionPointPair | A pair of positions (one from each Area) to connect. |