static public List<Path> PathLoad() { string line; Path sequence = new Path(); List<Path> paths = new List<Path>(); Point3D point = new Point3D(); StreamReader reader = new StreamReader(@".../.../loadpath.txt"); using (reader) { while ((line = reader.ReadLine()) != null) { if (line != "-") { string[] chars = line.Split(','); point.X = double.Parse(chars[0]); point.Y = double.Parse(chars[1]); point.Z = double.Parse(chars[2]); sequence.AddPointToSequence(point); } else { paths.Add(sequence); } } return paths; } }
static void Main() { Point3D point1 = new Point3D(2, 3, 8); Console.WriteLine(point1); Console.WriteLine(Point3D.Point0); double distance = TwoPointsDistance.CalcTwoPointsDistance(new Point3D(-7,5,2), new Point3D(5,-12,6)); Console.WriteLine(distance); Path sequence = new Path(); sequence.AddPointToSequence(point1); List<Path> paths = PathStorage.PathLoad(); foreach (var item in paths) { PathStorage.PathSave(item); } }