Show / Hide Table of Contents

Class ClosestConnectionPointSelector

Point selector that selects the two points from the MapArea instances that are closest to each other, according to the given distance calculation.

Inheritance
System.Object
ClosestConnectionPointSelector
Implements
IAreaConnectionPointSelector
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GoRogue.MapGeneration.Connectors
Assembly: GoRogue.dll
Syntax
public class ClosestConnectionPointSelector : IAreaConnectionPointSelector

Constructors

| Improve this Doc View Source

ClosestConnectionPointSelector(Distance)

Constructor.

Declaration
public ClosestConnectionPointSelector(Distance distanceCalculation)
Parameters
Type Name Description
Distance distanceCalculation

Distance calculation to use to determine closeness.

Properties

| Improve this Doc View Source

DistanceCalculation

Distance calculation to use to determine closeness.

Declaration
public Distance DistanceCalculation { get; }
Property Value
Type Description
Distance

Methods

| Improve this Doc View Source

SelectConnectionPoints(IReadOnlyMapArea, IReadOnlyMapArea)

Determines the two points in the given map areas that are closest to each other, and returns them as a tuple of two positions. The first position is the position in area1to use, and the second is the position in area2 to use.

Declaration
public Tuple<Coord, Coord> SelectConnectionPoints(IReadOnlyMapArea area1, IReadOnlyMapArea area2)
Parameters
Type Name Description
IReadOnlyMapArea area1

First MapArea to connect.

IReadOnlyMapArea area2

Second MapArea to connect.

Returns
Type Description
System.Tuple<Coord, Coord>

A tuple containing the coordinates from each MapArea to connect -- the first item in the tuple is the position in area1, the second is the position in area2.

Remarks

This algorithm can be relatively time-complex -- O(m*n) where m is the number of coordinates in area1, and n is the number of coordintes in area2.

Implements

IAreaConnectionPointSelector

Extension Methods

Utility.Yield<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX