/// <summary> /// Creates a clear map with a start and end point and sets up the search parameters /// </summary> private void InitializeMap(int[,] iMap, Point S, Point F) { this.map = IntToBool(iMap); //var tmp = BoolToString(map); //var tmp1 = ParseIntArrayToString(iMap); this.sp = new SearchParameters(S, F, map); }
/// <summary> /// Create a new instance of PathFinder /// </summary> /// <param name="searchParameters"></param> public PathFinder(SearchParameters searchParameters) { this.searchParameters = searchParameters; InitializeNodes(searchParameters.Map); this.startNode = this.nodes[searchParameters.StartLocation.X, searchParameters.StartLocation.Y]; this.startNode.State = NodeState.Open; this.endNode = this.nodes[searchParameters.EndLocation.X, searchParameters.EndLocation.Y]; }