Düzenle

Aracılığıyla paylaş


GKGraphNode.GetEstimatedCost(GKGraphNode) Method

Definition

The estimated cost to traverse from this GKGraphNode to node.

[Foundation.Export("estimatedCostToNode:")]
public virtual float GetEstimatedCost (GameplayKit.GKGraphNode node);
abstract member GetEstimatedCost : GameplayKit.GKGraphNode -> single
override this.GetEstimatedCost : GameplayKit.GKGraphNode -> single

Parameters

Returns

A value that must not exceed the true cost (see GetCost(GKGraphNode)) of travel.

Attributes

Remarks

This value is used in successive approximations of the true lowest-cost path. If overridden, this method must provide an admissible heuristic: the value returned must not exceed the true cost. (For instance, if there are no terrain effects or other complications, the straight line distance between node locations is admissible, since any real path will be at least that large.)

GetCost(GKGraphNode) returns the true cost of traversing from a node to its connected neighbor. This method, if overloaded, must provide estimates for all nodes, whether they are connected or not.

Applies to