示例#1
0
        /*
         * Вывод поля на экран
         */
        public static void WriteTable()
        {
            Console.Clear();
            var startX = (Measurements.GetWindowSizeX() / 2) - (tableSizeX / 2);
            //var startY = (Measurements.windowSizeY / 2) - (tableSizeY / 2);
            var startY = 0;

            ConvertFromPlayerCodesToChar();

            Console.SetCursorPosition(startX, startY);
            Console.Write("   |   |   ");
            Console.SetCursorPosition(startX, startY + 1);
            Console.Write(" " + fielsChar[0, 0] + " | " + fielsChar[1, 0] + " | " + fielsChar[2, 0] + " ");
            Console.SetCursorPosition(startX, startY + 2);
            Console.Write("   |   |   ");
            Console.SetCursorPosition(startX, startY + 3);
            Console.Write("---+---+---");
            Console.SetCursorPosition(startX, startY + 4);
            Console.Write("   |   |   ");
            Console.SetCursorPosition(startX, startY + 5);
            Console.Write(" " + fielsChar[0, 1] + " | " + fielsChar[1, 1] + " | " + fielsChar[2, 1] + " ");
            Console.SetCursorPosition(startX, startY + 6);
            Console.Write("   |   |   ");
            Console.SetCursorPosition(startX, startY + 7);
            Console.Write("---+---+---");
            Console.SetCursorPosition(startX, startY + 8);
            Console.Write("   |   |   ");
            Console.SetCursorPosition(startX, startY + 9);
            Console.Write(" " + fielsChar[0, 2] + " | " + fielsChar[1, 2] + " | " + fielsChar[2, 2] + " ");
            Console.SetCursorPosition(startX, startY + 10);
            Console.Write("   |   |   ");

            ShowWhoseStep.WritePlayersName(isMultiplayer);
        }
示例#2
0
        static void Main(string[] args)
        {
            IsConsoleCursorVisible();
            Music.InitMusic();
            Preview.InitPreview();
            Menu.InitMenu();

            Cursor.InitCursor();
            var decision = Cursor.ReturnMainMenuDecision();

            if (decision == MenuDecision.EXIT)
            {
                Exit();
            }

            if (decision == MenuDecision.PLAYER_VS_PLAYER)
            {
                ShowWhoseStep.WritePlayersName(true);
            }
            else
            {
                ShowWhoseStep.WritePlayersName(false);
            }

            while (true)
            {
                ShowCoordinatesOfCells.WriteTable();

                if (decision == MenuDecision.PLAYER_VS_PLAYER)
                {
                    Game.StartGame(GameMode.PLAYER_VS_PLAYER);
                }
                else if (decision == MenuDecision.PLAYER_VS_COMPUTER)
                {
                    Game.StartGame(GameMode.PLAYER_VS_COMPUTER);
                }

                ManuAfterGame.InitMenu();
                Cursor.InitCursor(true);
                var decision0 = Cursor.ReturnAfterGameDecision();
                if (decision0 == AfterGameDesicion.EXIT)
                {
                    break;
                }
            }

            Exit();
        }