当前位置: 首页>>代码示例>>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;未经允许,请勿转载。