public GoalBounding(NavMeshPathGraph navMesh, BoundingBox mapSize) {

            //Hack to access private field with all the nodes of the mesh
            List<NavigationGraphNode> nodeList = (List<NavigationGraphNode>)Utils.Reflection.GetInstanceField(
                    typeof(RAINNavigationGraph), navMesh, "_pathNodes");
            nodeInfos = new NodeRecordArray(nodeList, mapSize);
        }
 public NodeArrayAStarPathFinding(NavMeshPathGraph graph, IHeuristic heuristic) : base(graph, null, null, heuristic)
 {
     //do not change this
     var nodes = this.GetNodesHack(graph);
     this.NodeRecordArray = new NodeRecordArray(nodes);
     this.Open = this.NodeRecordArray;
     this.Closed = this.NodeRecordArray;
 }
        public NodeRecordArray readFile(NodeRecordArray nodeRecordArray)
        {
            StreamReader sr = new StreamReader(fileName);
            string line = sr.ReadLine();
            int i = -1;
            int j = -1;
            //Continue to read until you reach end of file
            while (line != null)
            {
                string[] lineAux = null;

                //Read the next line
                switch (line) {
                    case "<nodeRecord>":
                        i = -1;
                        j++;
                        break;
                    case "  <bounds>":
                        i++;
                        break;
                    case "</nodeRecord>":
                        break;
                    case "  </bounds>":
                        break;
                    default:
                        lineAux = line.Split('<', '>');
                        break;
                }
                
                if (line.Contains("<minX>"))
                {

                    nodeRecordArray.NodeRecords[j].edgeBounds[i].minX=float.Parse(lineAux[2]);
                }
                else if (line.Contains("<minZ>"))
                {
                    nodeRecordArray.NodeRecords[j].edgeBounds[i].minZ = float.Parse(lineAux[2]);
                }
                else if (line.Contains("<maxX>"))
                {
                    nodeRecordArray.NodeRecords[j].edgeBounds[i].maxX = float.Parse(lineAux[2]);
                }
                else if (line.Contains("<maxZ>"))
                {
                    nodeRecordArray.NodeRecords[j].edgeBounds[i].maxZ = float.Parse(lineAux[2]);
                }

                line = sr.ReadLine();

            }
            sr.Close();
            return nodeRecordArray;    
        }
 public override void RestartNodeArray(NavMeshPathGraph graph)
 {
     var nodes = this.GetNodesHack(graph);
     this.NodeRecordArray = new NodeRecordArray(nodes);
 }
 public DijkstraFloodfill(NodeRecordArray nodeRecords) {
     this.NodeRecords = nodeRecords;
 }