Table of Contents

Class DistanceComparer<TValue>

Namespace
Uncreated.Warfare.Util
Assembly
Uncreated.Warfare.dll
public class DistanceComparer<TValue> : IComparer<TValue>

Type Parameters

TValue
Inheritance
DistanceComparer<TValue>
Implements
IComparer<TValue>
Inherited Members

Constructors

DistanceComparer(Vector3, Func<TValue, Vector3>, bool, bool)

public DistanceComparer(Vector3 position, Func<TValue, Vector3> getPosition, bool horizontalDistanceOnly, bool reverse)

Parameters

position Vector3
getPosition Func<TValue, Vector3>
horizontalDistanceOnly bool
reverse bool

Methods

Compare(TValue, TValue)

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

public int Compare(TValue a, TValue b)

Parameters

a TValue
b TValue

Returns

int

A signed integer that indicates the relative values of x and y, as shown in the following table.
Value

Meaning

Less than zero

x is less than y.

Zero

x equals y.

Greater than zero

x is greater than y.