コード例 #1
0
ファイル: ConsoleUI.cs プロジェクト: Mysterio18/BlackJack
        private void GettingCardInteraction(ILogic Logic)
        {
            Logic.GetCardToPlayerSet();

            ShowPlayerTookInf(Logic.GetCardsOfPlayer().Last());
            WaitKey();

            if (!Logic.CheckValidSum(Logic.GetCardsOfPlayer()))
            {
                ShowComputerWin();
                WaitKey();
                Logic.ClearSets();
                ClearScreen();
                MenuState.Back();
                return;
            }
            if (!Logic.CheckValidSum(Logic.GetCardsOfComputer()))
            {
                ShowPlayerWin();
                WaitKey();
                Logic.ClearSets();
                ClearScreen();
                MenuState.Back();
                return;
            }

            if (Logic.ComputerTakingCard())
            {
                ShowComputerTookInf();
                WaitKey();
            }
            else
            {
                ShowComputerOpenInf(Logic);
                WaitKey();
                OpeningCardsInteraction(Logic);
            }

            ClearScreen();
            ShowSetOfCards(Logic.GetCardsOfPlayer());
        }
コード例 #2
0
ファイル: ConsoleUI.cs プロジェクト: Mysterio18/BlackJack
        private void OpeningCardsInteraction(ILogic Logic)
        {
            if (Logic.IsPlayerWinner())
            {
                ShowPlayerWin();
            }
            else
            {
                ShowComputerWin();
            }

            WaitKey();
            ClearScreen();
            Logic.ClearSets();
            MenuState.Back();
        }