예제 #1
0
 private void InitRound(Croupier croupier, Player gamer)
 {
     PrintInfo.PrintScore(gamer.Win, gamer.Loss);
     GiveCard(gamer, 2);
     GiveCard(croupier, 1);
     ShowPlayersCards(croupier, gamer);
 }
예제 #2
0
        private void ShowPlayersCards(Croupier croupier, Player gamer)
        {
            PrintInfo.PrintOtherMes(TypeMessage.CardCroupier);
            PrintInfo.PrintCards(croupier.PlayerCards);
            PrintInfo.PrintSpot(PlayerSpot(croupier));

            PrintInfo.PrintOtherMes(TypeMessage.CardPlayer);
            PrintInfo.PrintCards(gamer.PlayerCards);
            PrintInfo.PrintSpot(PlayerSpot(gamer));
        }
예제 #3
0
 private void StepCoupier()
 {
     // Croupier must say enough while spot more then 17 point
     while (_croupier.State == StatusPlayer.Play)
     {
         if (PlayerSpot(_croupier) > 17)
         {
             _croupier.State = StatusPlayer.Enough;
             break;
         }
         PrintInfo.PrintOtherMes(TypeMessage.StepCroupier);
         GiveCard(_croupier, 1);
         ShowPlayersCards(_croupier, _gamer);
     }
 }
예제 #4
0
        private ConsoleKeyInfo ChooseGamerDraw()
        {
            ConsoleKeyInfo cki;

            while (true)
            {
                PrintInfo.PrintOtherMes(TypeMessage.FinishRound);
                cki = WorkKey.GetPressKey();
                if (WorkKey.CompareKey(cki, ConsoleKey.Y) || WorkKey.CompareKey(cki, ConsoleKey.N))
                {
                    break;
                }
            }
            return(cki);
        }
예제 #5
0
 private void FinishRound(ResultGame res)
 {
     _gamer.State    = StatusPlayer.Play;
     _croupier.State = StatusPlayer.Play;
     _gamer.GiveBackCards();
     _croupier.GiveBackCards();
     if (res == ResultGame.Draw)
     {
         PrintInfo.PrintResult(ResultGame.Draw);
     }
     if (res == ResultGame.Loss)
     {
         _gamer.Loss += 1;
         PrintInfo.PrintResult(ResultGame.Loss);
     }
     if (res == ResultGame.Win)
     {
         _gamer.Win += 1;
         PrintInfo.PrintResult(ResultGame.Win);
     }
 }
예제 #6
0
        private void StepGamer()
        {
            ConsoleKeyInfo cki;

            while (_gamer.State == StatusPlayer.Play)
            {
                PrintInfo.PrintOtherMes(TypeMessage.MenuPlayer);
                cki = WorkKey.GetPressKey();
                //Gamer take one card
                if (WorkKey.CompareKey(cki, ConsoleKey.F5))
                {
                    StepGamerTakeOneCard(_gamer);
                }
                //Gamer refuse one card
                if (WorkKey.CompareKey(cki, ConsoleKey.F6))
                {
                }
                // Gamer say Enough
                if (WorkKey.CompareKey(cki, ConsoleKey.F7))
                {
                    _gamer.State = StatusPlayer.Enough;
                }
            }
        }
예제 #7
0
 private void CroupierTakeSecondCard()
 {
     PrintInfo.PrintOtherMes(TypeMessage.StepCroupier);
     GiveCard(_croupier, 1);
     ShowPlayersCards(_croupier, _gamer);
 }