コード例 #1
0
ファイル: Preview.cs プロジェクト: lkorasik/ZeroCross
 /*
  * Заполнение массива цветов красным и черным цветом
  * первые 7 строк - красные
  * осатльные 2 - черные
  */
 private static void FillBackground()
 {
     for (int x = 0; x < Measurements.GetPreviewSizeX(); x++)
     {
         for (int y = 0; y < Measurements.GetPreviewSizeY(); y++)
         {
             if (y >= 10)
             {
                 field[x, y] = ConsoleColor.Black;
             }
             else
             {
                 field[x, y] = ConsoleColor.Red;
             }
         }
     }
 }
コード例 #2
0
        public static void WritePlayersName(bool isMultiplayer)
        {
            Console.SetCursorPosition(Measurements.GetWindowSizeX() - 1 - player.Length, 1);
            Console.Write(player);

            if (isMultiplayer)
            {
                Console.SetCursorPosition(1, 1);
                Console.Write(player);
            }
            else
            {
                Console.SetCursorPosition(1, 1);
                Console.Write(computer);
            }

            Console.SetCursorPosition(Measurements.GetWindowSizeX() / 2, Measurements.GetWindowSizeY() - 2);
        }