Node.CompareTo method

Versione italiana
Compare this istance with another one first by path score then by current cost.

Syntax:
int CompareTo(Node other);

Parameters

Name Type Description
other Node Other node to compare

Return

An integer number that indicate this Node istance cost is minor, major or equal to another Node istance.

Less than zero: This node have the path score less than other node or the path score equal and the current cost less than other node.
Zero: This node have the path score and the current cost equal to other node.
Greater than zero: This node have the path score greater than other node or the current cost greater and the path score equal than other node.

Remarks

This method is used to know is a node is better than another node in the path finding, comparing first the the path score and then, if the result is equal, the current score.

Last edited May 26, 2010 at 8:12 AM by Arconte, version 2

Comments

No comments yet.