2016-11-25 00:05:29 -06:00
|
|
|
|
namespace SpriteCompiler.AI
|
|
|
|
|
{
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
public class HeuristicSearchNode<A, S, T, C> : AbstractSearchNode<A, S, T, C>, ISearchNode<A, S, T, C>
|
|
|
|
|
where T : HeuristicSearchNode<A, S, T, C>
|
2016-11-29 00:20:29 -06:00
|
|
|
|
where C : IPathCost<C>, new()
|
2016-11-25 00:05:29 -06:00
|
|
|
|
{
|
|
|
|
|
public HeuristicSearchNode(T node, S state)
|
|
|
|
|
: base(node, state)
|
|
|
|
|
{
|
2016-12-04 23:14:51 -06:00
|
|
|
|
Heuristic = new C();
|
2016-11-25 00:05:29 -06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public C Heuristic { get; set; }
|
2016-12-04 23:14:51 -06:00
|
|
|
|
|
|
|
|
|
public override C EstCost
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return PathCost.Add(Heuristic);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-25 00:05:29 -06:00
|
|
|
|
}
|
|
|
|
|
}
|