namespace SpriteCompiler.Problem { using SpriteCompiler.AI; using SpriteCompiler.AI.Queue; using System; public sealed class SpriteGeneratorSearchProblem : SearchProblem { public SpriteGeneratorSearchProblem() : base( new SpriteGeneratorGoalTest(), new SpriteGeneratorStepCost(), new SpriteGeneratorSuccessorFunction(), new SpriteGeneratorHeuristicFunction() ) { } public static SpriteGeneratorSearchProblem CreateSearchProblem() { return new SpriteGeneratorSearchProblem(); } public static ISearch Create() { var expander = new SpriteGeneratorNodeExpander(); var strategy = new TreeSearch(expander); Func> queue = () => new Adapters.QueueAdapter(); return new AStarSearch(strategy, queue); } public static ISearch Create(int maxCycles) { var expander = new SpriteGeneratorNodeExpander(); var strategy = new TreeSearch(expander); var maxCost = (IntegerCost)maxCycles; return new IterativeDeepeningAStarSearch(strategy, maxCost); } } }