private void DealInitialCards() { _playersHand = new Hand(); _dealersHand = new Hand(); for (int i = 0; i < InitialNumberOfCards; i++) { _playersHand.AddCard(_cardsProvider.Deal()); _dealersHand.AddCard(_cardsProvider.Deal()); } OnPropertyChanged(nameof(PlayersCards)); OnPropertyChanged(nameof(DealersCards)); }
public void Play(Hand dealersHand, IEndlessCardsProvider cardsProvider) { if (dealersHand == null) throw new ArgumentNullException(nameof(dealersHand)); if (cardsProvider == null) throw new ArgumentNullException(nameof(cardsProvider)); while (dealersHand.GetValue() < _level) { dealersHand.AddCard(cardsProvider.Deal()); } }
public void Play(Hand dealersHand, IEndlessCardsProvider cardsProvider) { if (dealersHand == null) { throw new ArgumentNullException(nameof(dealersHand)); } if (cardsProvider == null) { throw new ArgumentNullException(nameof(cardsProvider)); } while (dealersHand.GetValue() < _level) { dealersHand.AddCard(cardsProvider.Deal()); } }