From dbd7f66c89d9187e38e2697a8fad5d5ff3fc39be Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 18 Feb 2023 12:32:32 +0100 Subject: [PATCH] slightly improved A* documentation --- MLEM/Pathfinding/AStar.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/MLEM/Pathfinding/AStar.cs b/MLEM/Pathfinding/AStar.cs index cc8d3f1..c1f7222 100644 --- a/MLEM/Pathfinding/AStar.cs +++ b/MLEM/Pathfinding/AStar.cs @@ -209,28 +209,28 @@ namespace MLEM.Pathfinding { /// public readonly T Pos; /// - /// The F cost of this path point + /// The F cost of this path point, which is the estimated total distance from the start to the goal. /// public readonly float F; /// - /// The G cost of this path point + /// The G cost of this path point, which is the actual distance from the start to the current . /// public readonly float G; /// /// Creates a new path point with the supplied settings. /// - /// The point's position - /// The point's distance from the start point - /// The point's parent - /// The point's terrain cost, based on - /// The default cost for a path point - public PathPoint(T pos, float distance, PathPoint parent, float terrainCostForThisPos, float defaultCost) { + /// The point's position. + /// The point's estimated distance from the to the goal, based on the . + /// The point's parent. + /// The terrain cost to move from the to this point, based on . + /// The default cost for a path point. + public PathPoint(T pos, float heuristicDistance, PathPoint parent, float terrainCost, float defaultCost) { this.Pos = pos; this.Parent = parent; - this.G = (parent == null ? 0 : parent.G) + terrainCostForThisPos; - this.F = this.G + distance * defaultCost; + this.G = (parent == null ? 0 : parent.G) + terrainCost; + this.F = this.G + heuristicDistance * defaultCost; } /// Indicates whether the current object is equal to another object of the same type.