mirror of
https://github.com/lscharen/iigs-sprite-compiler.git
synced 2024-10-14 00:23:39 +00:00
20 lines
418 B
C#
20 lines
418 B
C#
namespace SpriteCompiler.AI
|
|
{
|
|
public class DepthNodeLimiter<T, C> : INodeLimiter<T, C>
|
|
where T : ISearchNode<C>
|
|
where C : ICost<C>, new()
|
|
{
|
|
private readonly int maxDepth;
|
|
|
|
public DepthNodeLimiter(int maxDepth)
|
|
{
|
|
this.maxDepth = maxDepth;
|
|
}
|
|
|
|
public bool Cutoff(T node)
|
|
{
|
|
return node.Depth >= maxDepth;
|
|
}
|
|
}
|
|
}
|