root/src/BRAINSFramework/PathFinding/NodeComparer.cs

User picture

Author: conkerjo

Revision: 30 («Previous)


File Size: 444 Bytes

(July 01, 2009 23:02 UTC) Almost 3 years ago


  

 
Show/hide line numbers
using System;
using System.Collections.Generic;
using System.Text;

namespace Brains.Framework.PathFinding
{
    public class NodeComparer : IComparer<PathfinderNode>
    {
        public int Compare(PathfinderNode nodeA, PathfinderNode nodeB)
        {
            if (nodeA.F > nodeB.F)
                return 1;
            else if (nodeA.F < nodeB.F)
                return -1;
            return 0;
        }

    }
}