Class ManhattanDistance
Represents manhattan distance (equivalent to 4-way, cardinal-only movement).
Implements
Inherited Members
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
[DataContract]
public class ManhattanDistance : Distance, IMatchable<Distance>
Remarks
You can't create instances of this class; instead, use Manhattan.
Methods
View SourceCalculate(double, double)
Returns the distance between two locations, given the change in X and change in Y value.
Declaration
public override double Calculate(double dx, double dy)
Parameters
| Type | Name | Description |
|---|---|---|
| double | dx | The delta-x between the two locations. |
| double | dy | The delta-y between the two locations. |
Returns
| Type | Description |
|---|---|
| double | The distance between two locations with the given delta-change values. |