mirror of
https://github.com/lscharen/iigs-sprite-compiler.git
synced 2024-12-21 01:29:59 +00:00
22 lines
519 B
C#
22 lines
519 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SpriteCompiler.AI
|
|
{
|
|
public class AStarComparator<A, S, T, C> : IComparer<T>
|
|
where T : HeuristicSearchNode<A, S, T, C>
|
|
where C : IPathCost<C>, new()
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
}
|