using System.Collections.Generic; using System.IO; namespace TSP { public struct Coordinate { public int X { get; set; } public int Y { get; set; } public Coordinate(int x, int y) { X = x; Y = y; } public Coordinate(string coords) { string[] items = coords.Split(','); X = int.Parse(items[0]); Y = int.Parse(items[1]); } public static List Parse(string file) { List coordinates = new List(); foreach (string coords in File.ReadAllLines(file)) coordinates.Add(new Coordinate(coords)); return coordinates; } public override string ToString() => $"({X}, {Y})"; } }