Esempio n. 1
0
        public static void SavePath(Path3D p)
        {
            using (var fs = File.Open("file.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite))
            {
                var sw = new StreamWriter(fs);

                foreach (var point in p.Path)
                {
                    sw.Write(point);
                }

                sw.Flush();
                sw.Close();
            }
        }
Esempio n. 2
0
        private static void Main()
        {
            //Printing point.
            Console.WriteLine(new Point3D(5, 6, 5));

            //Distance calc.
            var pointA = new Point3D(1, 2, 3);
            var pointB = new Point3D(3, 4, 5);

            Console.WriteLine(DistanceCalculator.Distance(pointA, pointB));

            //Path
            var path = new Path3D(new[] { pointA, pointB });

            Storage.SavePath(path);

            Storage.LoadPaths();
        }
Esempio n. 3
0
        private static void Main()
        {
            //Printing point.
            Console.WriteLine(new Point3D(5, 6, 5));

            //Distance calc.
            var pointA = new Point3D(1, 2, 3);
            var pointB = new Point3D(3, 4, 5);

            Console.WriteLine(DistanceCalculator.Distance(pointA, pointB));

            //Path
            var path = new Path3D(new[] {pointA, pointB});

            Storage.SavePath(path);

            Storage.LoadPaths();
        }