Exemplo n.º 1
0
 private void InitRound(Croupier croupier, Player gamer)
 {
     PrintInfo.PrintScore(gamer.Win, gamer.Loss);
     GiveCard(gamer, 2);
     GiveCard(croupier, 1);
     ShowPlayersCards(croupier, gamer);
 }
Exemplo n.º 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));
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 7
0
 private void CroupierTakeSecondCard()
 {
     PrintInfo.PrintOtherMes(TypeMessage.StepCroupier);
     GiveCard(_croupier, 1);
     ShowPlayersCards(_croupier, _gamer);
 }