public static Path?Find(IBitmap bountry, VectorInt2 start, VectorInt2 end) { var evaluator = new Evaluator(bountry, end); var itt = new BreadthFirstItterator <Node>(); var root = new Node { Position = start }; var sol = itt.Evaluate(root, evaluator, new ExitConditions { StopOnFirstSolution = true } ); if (sol == null || sol.Count == 0) { return(null); } return(ToPath(sol.First().PathToRoot())); }
public static Result Find(StaticMaps staticMaps, IStateMaps state, VectorInt2 crate, VectorInt2 player) { var start = new Node { PlayerAfter = player, CrateTarget = crate, Maps = state }; var evaluator = new Evaluator(new Bitmap(state.CrateMap.Size), staticMaps); var itt = new BreadthFirstItterator <Node>(); itt.Evaluate(start, evaluator, new ExitConditions { StopOnFirstSolution = true } ); return(new Result { CrateMap = evaluator.CrateMap, Root = start }); }