Thinking about a property for a DealerHand and a PlayerHand you might find it easier to find issues if the Hands were condensed into a Dictionay<string, List<Card>>. For now it would simplify this area in `BlackjackGame.cs#L135-146:
public void DealCard(string dealee)
{
if (dealee == "Dealer")
{
DealerHand.Add(_deck.DrawCard());
}
if (dealee == "Player")
{
PlayerHand.Add(_deck.DrawCard());
}
UpdateUI();
}
Could be
public void DealCard(string dealee)
{
Hands[dealee].Add(_deck.DrawCard()); // Could use TryGetValue for more safety but the same principle
UpdateUI();
}
But this would mean that you would already have fundamental support for more players as well.
Thinking about a property for a
DealerHand
and aPlayerHand
you might find it easier to find issues if the Hands were condensed into aDictionay<string, List<Card>>
. For now it would simplify this area in `BlackjackGame.cs#L135-146:Could be
But this would mean that you would already have fundamental support for more players as well.