当前位置: 首页>>代码示例>>C#>>正文


C# Path.Remove方法代码示例

本文整理汇总了C#中Path.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Path.Remove方法的具体用法?C# Path.Remove怎么用?C# Path.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Path的用法示例。


在下文中一共展示了Path.Remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    static void Main()
    {
        Point3D a = new Point3D(1, 2, 3);
        Console.WriteLine("Point({0})", a); // point A

        Point3D b = Point3D.Center;
        Console.WriteLine("Point({0}, {1}, {2})", b.X, b.Y, b.Z); // point O
        
        Console.WriteLine("Distance: {0}", Distance.Calculate(a, b)); // Calculate distance

        // Path of points
        Path path = new Path(new Point3D(1, 1, 1), new Point3D(2, 2, 2));
        path.Add(new Point3D(3, 3, 3));
        path.Remove(new Point3D(1, 1, 1));
        Console.WriteLine("\nPoints in path (total: {0})\n{1}", path.Count, path);

        path.Clear();

        // Loads new points from the file
        path = PathStorage.Load("../../input.txt");
        Console.WriteLine("\nPoints in path (total: {0})\n{1}", path.Count, path);

        // Saves the points in output file
        PathStorage.Save(path, "../../output.txt");
    }
开发者ID:jesconsa,项目名称:Telerik-Academy,代码行数:25,代码来源:Program.cs

示例2: AStarTestPathExistsStartisGoalwEdges

        public void AStarTestPathExistsStartisGoalwEdges()
        {
            InitializeStarGraph();
            Path<Vertex<string>> expectedPath = new Path<Vertex<string>> { _vertex1 };
            Path<Vertex<string>> givenPath = _graph.AStar(_vertex1, _vertex1, 40);

            foreach (Vertex<string> vertex in givenPath)
            {
                expectedPath.Remove(vertex);
            }
            Assert.AreEqual(0, expectedPath.Count);
        }
开发者ID:Suralya,项目名称:AbgabePathfinding_GD0414_TinaPlavius_DanielMajonika,代码行数:12,代码来源:UndirectedGraphTests.cs

示例3: AStarTestPathExistsandGoesMostValuablePath

        public void AStarTestPathExistsandGoesMostValuablePath()
        {
            InitializePathfindingGraph();
            Path<Vertex<string>> expectedPath = new Path<Vertex<string>> { _vertex1, _vertex5, _vertex9, _vertex7 };
            Path<Vertex<string>> givenPath = _graph.AStar(_vertex1, _vertex7, 40);

            foreach (Vertex<string> vertex in givenPath)
            {
                expectedPath.Remove(vertex);
            }
            Assert.AreEqual(0, expectedPath.Count);
        }
开发者ID:Suralya,项目名称:AbgabePathfinding_GD0414_TinaPlavius_DanielMajonika,代码行数:12,代码来源:UndirectedGraphTests.cs

示例4: Main

    static void Main()
    {
        {
            Console.WriteLine("# Testing distance");

            Console.WriteLine("Distance: {0}", Distance.Calculate(new Point3D(1, 1, 1), Point3D.Zero));
            Console.WriteLine();
        }

        {
            Console.WriteLine("# Testing path");

            Point3D point = new Point3D(1, 1, 1);

            Path path = new Path();

            path.Add(point);
            path.Add(new Point3D(1, 2, 1));
            path.Add(new Point3D(1, 3, 1));
            path.Add(Point3D.Zero);

            Console.WriteLine(path);
            Console.WriteLine();

            {
                Console.WriteLine("# Testing remove");

                path.Remove(point);

                Console.WriteLine(path);
                Console.WriteLine();
            }

            {
                Console.WriteLine("# Testing path storage");

                PathStorage.Write(path);
                path = PathStorage.Load();

                Console.WriteLine(path);
            }
        }
    }
开发者ID:vstaykov,项目名称:TelerikAcademy,代码行数:43,代码来源:Program.cs


注:本文中的Path.Remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。