public void printSearchNode() { Console.Out.Write("\tSearchNode:"); if (Room != null) { Console.Out.Write(" Room: " + Room.Name); } Console.Out.Write(" Point: " + locationPoint.ToString()); if (Edge != null) { Console.Out.Write(Edge.ToString()); } Console.Out.Write(" ListOfPoints: ("); foreach (mPoint point in ListOfPointsInUV) { Console.Out.Write(point.ToString() + ", "); } Console.Out.WriteLine(" Distance: " + Math.Round(Distance, 2) + ")"); }
//************************************* Overridden Methods ************************************* public override string ToString() { return("(Name: " + Name + ", (U,V): " + Location.ToString() + " )"); }
//public void AddObject(MapObject nObject) //{ // foreach (List<mGridPoint> gridRows in ListOfGridPointRows) // { // foreach (mGridPoint gpoint in gridRows) // { // if (nObject.DoesContain(gpoint)) // { // gpoint.Passible = false; // } // } // } // ListOfObjects.Add(nObject); //} //************************************* Overriden Methods ************************************* public override string ToString() { string str = ""; str += "++++++++++ Room: " + Name + " ++++++++++\n"; str += "Root IPS (U,V): " + RootNodeUV.ToString() + "\n"; str += "Location (U,V): " + TopLeftCornerUV.ToString() + "\n"; str += "Dimentions(U,V): " + WidthU + ", " + LengthV + "\n"; str += "GridPoint Number: " + ListOfGridPointRows.Count + "\n"; str += "Edges: \n"; foreach (MapEdge cEdge in ListOfEdges) { str += cEdge.ToString() + "\n"; } str += "Objects: \n"; foreach (MapObject cObject in ListOfObjects) { str += cObject.ToString() + "\n"; } str += "Areas: \n"; foreach (MapArea cArea in ListOfAreas) { str += cArea.ToString() + "\n"; } str += "Grid Map: \n \t"; foreach (mGridPoint gpoint in ListOfGridPointRows[0]) { str += Math.Round(gpoint.X, 1) + "\t"; } str += "\n"; foreach (List <mGridPoint> gridRows in ListOfGridPointRows) { str += Math.Round(gridRows[0].Y, 1) + "\t"; foreach (mGridPoint gpoint in gridRows) { if (!gpoint.IsPassible()) { str += " X "; } else if (gpoint.IsPreferredPath()) { str += " P "; } else { str += " . "; } str += "\t"; } str += "\n"; } foreach (List <mGridPoint> gridRows in ListOfGridPointRows) { str += Math.Round(gridRows[0].Y, 1) + "\t"; foreach (mGridPoint gpoint in gridRows) { str += gpoint.Name; } str += "\n"; } return(str); }