Esempio n. 1
0
        private static void PlayersTurn(Board board)
        {
            Winner winner = new Winner(board);

            bool start      = true;
            var  tikTurn    = true;
            var  circleTurn = true;

            while (start)
            {
                if (tikTurn)
                {
                    var tikTurnResult = MoveTikPlayer(board);
                    if (tikTurnResult)
                    {
                        ConsoleMessage($"{Environment.NewLine}*** TIK STILL YOUR TURN *** {Environment.NewLine}", ConsoleColorList.warning);
                        PlayersTurn(board);
                    }
                    tikTurn    = false;
                    circleTurn = true;
                }

                if (circleTurn)
                {
                    var circleTurnResult = MoveCirclePlayer(board);
                    if (circleTurnResult)
                    {
                        ConsoleMessage($"{Environment.NewLine}*** CIRCLE STILL YOUR TURN *** {Environment.NewLine}", ConsoleColorList.warning);
                        MoveCirclePlayer(board);
                    }
                    circleTurn = false;
                    tikTurn    = true;
                }



                ConsoleMessage($"{Environment.NewLine}-----------------Board Updated-------------------{Environment.NewLine}", ConsoleColorList.warning);
                ConsoleMessage(board.ShowBoardGame(), ConsoleColorList.success);

                winner.PlayerWinner();
            }
        }