mirror of
https://github.com/lscharen/iigs-sprite-compiler.git
synced 2024-10-14 00:23:39 +00:00
31 lines
723 B
C#
31 lines
723 B
C#
namespace SpriteCompiler.AI
|
|
{
|
|
using System;
|
|
|
|
public interface IHeuristicSearchNode<A, S, T, C> : ISearchNode<A, S, T, C> where C : ICost<C>
|
|
{
|
|
C EstCost { get; }
|
|
}
|
|
|
|
public class HeuristicSearchNode<A, S, T, C> : AbstractSearchNode<A, S, T, C>, IHeuristicSearchNode<A, S, T, C>
|
|
where T : IHeuristicSearchNode<A, S, T, C>
|
|
where C : ICost<C>, new()
|
|
{
|
|
public HeuristicSearchNode(T node, S state)
|
|
: base(node, state)
|
|
{
|
|
Heuristic = new C();
|
|
}
|
|
|
|
public C Heuristic { get; set; }
|
|
|
|
public C EstCost
|
|
{
|
|
get
|
|
{
|
|
return PathCost.Add(Heuristic);
|
|
}
|
|
}
|
|
}
|
|
}
|