mirror of
https://github.com/lscharen/iigs-sprite-compiler.git
synced 2024-10-06 03:56:57 +00:00
32 lines
782 B
C#
32 lines
782 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SpriteCompiler.AI
|
|
{
|
|
public interface ISearchStepInfo<T>
|
|
{
|
|
bool IsGoal { get; }
|
|
T Node { get; }
|
|
IEnumerable<T> Solution { get; }
|
|
}
|
|
|
|
public class SearchStepInfo<T> : ISearchStepInfo<T>
|
|
{
|
|
private readonly T node;
|
|
private readonly IEnumerable<T> solution;
|
|
|
|
public SearchStepInfo(T node, IEnumerable<T> solution)
|
|
{
|
|
this.solution = solution;
|
|
this.node = node;
|
|
}
|
|
|
|
public IEnumerable<T> Solution { get { return solution; } }
|
|
public bool IsGoal { get { return solution != null; } }
|
|
public T Node { get { return node; } }
|
|
}
|
|
}
|