Exemple #1
0
    public int CompareTo(Node nodeToCompare)
    {
        //return HeapIndex.CompareTo(nodeToCompare.HeapIndex);
        int compare = TotalCost.CompareTo(nodeToCompare.TotalCost);

        if (compare == 0)
        {
            compare = heuristic.CompareTo(nodeToCompare.heuristic);
        }
        return(-compare);
    }
Exemple #2
0
    public int CompareTo(CardData other)
    {
        int elementCompareResult = elementalIdentity.CompareTo(other.elementalIdentity);

        if (elementCompareResult != 0)
        {
            return(elementCompareResult);
        }
        int costCompareResult = TotalCost.CompareTo(other.TotalCost);

        if (costCompareResult != 0)
        {
            return(costCompareResult);
        }
        // if cost and type are equal then go off names
        return(cardName.CompareTo(other.cardName));
    }
        public int CompareTo(object obj)
        {
            AbstractNode <T> temp = obj as AbstractNode <T>;

            if (temp == null)
            {
                throw new ArgumentException("Object is not an AbstractNode");
            }

            int result = TotalCost.CompareTo(temp.TotalCost);

            if (result != 0)
            {
                return(result);
            }

            return(EstimatedCost.CompareTo(temp.EstimatedCost));
        }
Exemple #4
0
 public int CompareTo(object obj)
 {
     return(-TotalCost.CompareTo(((AStarNode)obj).TotalCost));
 }
Exemple #5
0
 /// <summary>
 /// Compares the Nodes based on their total costs.
 /// Total Costs: A* Pathfinding.
 /// Current: Djikstra Pathfinding.
 /// Estimated: Greedy Pathfinding.
 /// </summary>
 /// <param name="other">The other node.</param>
 /// <returns>A comparison between the costs.</returns>
 public int CompareTo(Node other) => TotalCost.CompareTo(other.TotalCost);
Exemple #6
0
 /// <summary>
 ///     Compares the Nodes based on their total costs.
 ///     Total Costs: A* Pathfinding.
 ///     Current: Djikstra Pathfinding.
 ///     Estimated: Greedy Pathfinding.
 /// </summary>
 /// <param name="other">The other node.</param>
 /// <returns>A comparison between the costs.</returns>
 public int CompareTo(Node?other) => TotalCost.CompareTo(other?.TotalCost ?? 0);
Exemple #7
0
 public int CompareTo(InternalNode <T> other)
 {
     return(TotalCost.CompareTo(other.TotalCost));
 }