コード例 #1
0
ファイル: Figure.cs プロジェクト: Galiks/Mercury
        public static void Intersect(int index)
        {
            Figure figure = Figures[index - 1];

            foreach (var item in Figures)
            {
                if (item != figure)
                {
                    figure.Intersect(item);
                }
            }
        }
コード例 #2
0
 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");
     }
 }