mirror of
https://github.com/lscharen/iigs-sprite-compiler.git
synced 2024-12-21 01:29:59 +00:00
27 lines
720 B
C#
27 lines
720 B
C#
namespace SpriteCompiler.AI
|
|
{
|
|
using System.Collections.Generic;
|
|
|
|
public class NodeExpanderDelegator<A, S, T, C> : INodeExpander<A, S, T, C>
|
|
where T : ISearchNode<A, S, T, C>
|
|
where C : IPathCost<C>
|
|
{
|
|
private readonly INodeExpander<A, S, T, C> expander;
|
|
|
|
public NodeExpanderDelegator(INodeExpander<A, S, T, C> expander)
|
|
{
|
|
this.expander = expander;
|
|
}
|
|
|
|
public virtual IEnumerable<T> Expand(ISearchProblem<A, S, C> problem, T node)
|
|
{
|
|
return expander.Expand(problem, node);
|
|
}
|
|
|
|
public virtual T CreateNode(T parent, S state)
|
|
{
|
|
return expander.CreateNode(parent, state);
|
|
}
|
|
}
|
|
}
|