Example #1
0
        private void CheckDouble(DoubleColor color)
        {
            btnBlack.Visible   = false;
            btnRed.Visible     = false;
            btnCollect.Visible = false;
            cardImage.Image    = ImageHelper.GetCardImage(_currentCard);
            bool isWin = ResultHelper.IsDoubleWin(color, _currentCard.Color);

            if (isWin)
            {
                WinAmount *= 2;
            }
            else
            {
                WinAmount = 0;
            }

            if (!isWin)
            {
                btnClose.Visible = true;
            }
            else
            {
                TaskEx.Delay(1500).Wait();
                btnBlack.Visible   = true;
                btnRed.Visible     = true;
                btnCollect.Visible = true;
                _currentCard       = CardGenerator.GetRandomCard();
                cardImage.Image    = ImageHelper.Background;
            }

            lblWinAmount.Text = "Win: " + WinAmount;
        }
Example #2
0
 private void FormDouble_Load(object sender, EventArgs e)
 {
     cardImage.Image      = ImageHelper.Background;
     _currentCard         = CardGenerator.GetRandomCard();
     lblWinAmount.Visible = true;
     lblWinAmount.Text    = "Win: " + WinAmount;
 }
Example #3
0
 private void FillCurrent()
 {
     for (int i = 0; i < HAND_SIZE; i++)
     {
         if (State.CurrentCards[i] == null)
         {
             while (true)
             {
                 var newCard = CardGenerator.GetRandomCard();
                 if (!IsAlreadyDealt(newCard))
                 {
                     State.CurrentCards[i] = newCard;
                     break;
                 }
             }
         }
     }
 }