本文整理汇总了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);
}