public static Path LoadFile() { Path pathInUse = new Path(); using (loadFile) { string row = loadFile.ReadLine(); while (row != null) { string[] coords = row.Split(); Point3DCoord currentPoint = new Point3DCoord() { X = double.Parse(coords[0]), Y = double.Parse(coords[1]), Z = double.Parse(coords[2]), }; pathInUse.InsertPoint(currentPoint); row = loadFile.ReadLine(); } } return(pathInUse); }
static void Main() { Path newPath = PathStorage.LoadFile(); Point3DCoord point = new Point3DCoord(5, 10, 15); newPath.InsertPoint(point); foreach (var item in newPath.pathToSequence) { Console.WriteLine(item.ToString()); } PathStorage.SaveFile(newPath); Point3DCoord firstPoint = new Point3DCoord(1, 1, 2); Point3DCoord secondPoint = new Point3DCoord(2, 1, 1); Console.WriteLine(CalculateDistance.DistanceCalculation(firstPoint, secondPoint)); }