예제 #1
0
        public void Blackjack()
        {
            this.Result = Result.Blackjack;
            var args = new OnCardReceivedEventArgs(this, null);

            onDealerBlackjack?.Invoke(this, args);
        }
예제 #2
0
        public void AddCard(Card card)
        {
            this.Cards.Add(card);
            var args = new OnCardReceivedEventArgs(this, card);

            onCardReceived?.Invoke(this, args);
        }
예제 #3
0
        private void giveDealerACard()
        {
            Card card = this.Shoe.NextCard;

            Dealer.Hand.Cards.Add(card);
            var args = new OnCardReceivedEventArgs(Dealer.Hand, card);

            onDealerCardReceived?.Invoke(this, args);
        }
예제 #4
0
        public Card RemoveCard(int index)
        {
            var result = this.Cards[index];

            this.Cards.Remove(result);
            var args = new OnCardReceivedEventArgs(this, result);

            onCardReceived?.Invoke(this, args);


            return(result);
        }
예제 #5
0
 public override bool CheckIsBust()
 {
     if (CurrentScore > 21)
     {
         this.Result = Result.Bust;
         var args = new OnCardReceivedEventArgs(this, null);
         onDealerBust?.Invoke(this, args);
         return(true);
     }
     else
     {
         return(false);
     }
 }