本文整理匯總了C#中System.Logger.addToLog方法的典型用法代碼示例。如果您正苦於以下問題:C# Logger.addToLog方法的具體用法?C# Logger.addToLog怎麽用?C# Logger.addToLog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Logger
的用法示例。
在下文中一共展示了Logger.addToLog方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: run
public static void run(String[] args)
{
Logger log = new Logger();
Stopwatch s = new Stopwatch();
log.addToLog("Map initializing...");
AStarMap map = new AStarMap(mapData.getMapWidth(), mapData.getMapHeight(), mapData.getObstacleMap());
s.Start();
PathFinder pathfinder = new PathFinder(map);
Point start = new Point(startX, startY);
Point goal = new Point(goalX, goalY);
List<Point> optimizedWaypoints = pathfinder.findStraightPath(start, goal);
s.Stop();
log.addToLog("Total pathfinding took: " + s.ElapsedMilliseconds + " ms");
log.addToLog("Printing map of optimized path...");
new PrintMap(map, optimizedWaypoints);
}
示例2: run
public static void run(String[] args)
{
Logger log = new Logger();
Stopwatch s = new Stopwatch();
log.addToLog("Map initializing...");
AStarMap map = new AStarMap(mapData.getMapWidth(), mapData.getMapHeight(), mapData.getObstacleMap());
log.addToLog("Heuristic initializing...");
//AStarHeuristic heuristic = new ClosestHeuristic();
AStarHeuristic heuristic = new DiagonalHeuristic();
log.addToLog("AStar initializing...");
AStar aStar = new AStar(map, heuristic);
log.addToLog("Calculating shortest path...");
s.Start();
List<Point> shortestPath = aStar.calcShortestPath(startX, startY, goalX, goalY);
s.Stop();
log.addToLog("Time to calculate path in milliseconds: " + s.ElapsedMilliseconds);
log.addToLog("Printing map of shortest path...");
new PrintMap(map, shortestPath);
}
示例3: run
public static void run(String[] args)
{
Point a = new Point(49, 49);
Point b = new Point(0, 0);
Logger log = new Logger();
Stopwatch s = new Stopwatch();
log.addToLog("Initializing "+mapWidth+"x"+mapHeight+" map...");
initMap();
AStarMap map = new AStarMap(mapWidth, mapHeight, obstacleMap);
log.addToLog("Generating Bresenham's Line from "+a.x+","+a.y+" to "+b.x+","+b.y+"...");
s.Start();
List<Point> line = Bresenham.getCellsOnLine(a, b);
s.Stop();
log.addToLog("Generation took " + s.ElapsedMilliseconds + " ms");
String str = "";
foreach(Point point in line)
{
str = str+"("+point.x+","+point.y+") ";
}
log.addToLog("Line is:" + str);
log.addToLog("Writing line to map...");
log.addToLog("Printing map...");
new PrintMap(map, line);
}