public static void Intersect(int index) { Figure figure = Figures[index - 1]; foreach (var item in Figures) { if (item != figure) { figure.Intersect(item); } } }
private static void GetIntersect(string[] splitCommand) { if (splitCommand.Length == 2) { if (Int32.TryParse(splitCommand[1], out int index)) { Figure.Intersect(index); } else { Console.WriteLine("Incorrect syntax"); } } else { Console.WriteLine("Unknown command"); } }