當前位置: 首頁>>代碼示例>>C#>>正文


C# Logger.addToLog方法代碼示例

本文整理匯總了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);
        }
開發者ID:gaopan461,項目名稱:astar-java-csharp,代碼行數:21,代碼來源:TestPathFinder.cs

示例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);
        }
開發者ID:gaopan461,項目名稱:astar-java-csharp,代碼行數:25,代碼來源:TestAStar.cs

示例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);
        }
開發者ID:gaopan461,項目名稱:astar-java-csharp,代碼行數:29,代碼來源:TestBresenhamsLine.cs


注:本文中的System.Logger.addToLog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。