Class PathPoint<T>
- Namespace
- MLEM.Pathfinding
- Assembly
- MLEM.dll
A point in a AStar<T> path
public class PathPoint<T> : IEquatable<PathPoint<T>>
Type Parameters
T
The type of point used for this path
- Inheritance
-
PathPoint<T>
- Implements
-
IEquatable<PathPoint<T>>
- Inherited Members
Constructors
PathPoint(T, float, PathPoint<T>, float, float)
Creates a new path point with the supplied settings.
public PathPoint(T pos, float heuristicDistance, PathPoint<T> parent, float terrainCost, float defaultCost)
Parameters
pos
TThe point's position.
heuristicDistance
floatThe point's estimated distance from the
pos
to the goal, based on thedefaultCost
.parent
PathPoint<T>The point's parent.
terrainCost
floatThe terrain cost to move from the
parent
to this point, based on AStar<T>.GetCost.defaultCost
floatThe default cost for a path point.
Fields
F
The F cost of this path point, which is the estimated total distance from the start to the goal.
public readonly float F
Field Value
G
The G cost of this path point, which is the actual distance from the start to the current Pos.
public readonly float G
Field Value
Parent
The path point that this point originated from
public readonly PathPoint<T> Parent
Field Value
- PathPoint<T>
Pos
The position of this path point
public readonly T Pos
Field Value
- T
Methods
Equals(PathPoint<T>)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(PathPoint<T> other)
Parameters
other
PathPoint<T>An object to compare with this object.
Returns
- bool
true if the current object is equal to the
other
parameter; otherwise, false.
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.