using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SpriteCompiler.AI { public class AStarComparator : IComparer where T : HeuristicSearchNode where C : IPathCost { public int Compare(T x, T y) { var cost1 = x.Heuristic.Add(x.PathCost); var cost2 = y.Heuristic.Add(y.PathCost); return cost1.CompareTo(cost2); } } }