2016-12-09 03:59:21 +00:00
|
|
|
|
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>
|
2016-12-12 06:41:35 +00:00
|
|
|
|
where C : ICost<C>
|
2016-12-09 03:59:21 +00:00
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
2016-12-12 06:41:35 +00:00
|
|
|
|
|
|
|
|
|
public virtual T CreateNode(S state)
|
|
|
|
|
{
|
|
|
|
|
return expander.CreateNode(state);
|
|
|
|
|
}
|
2016-12-09 03:59:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|