/// <summary> /// Update the GUI /// </summary> /// <param name="dealerShow"></param> public void UpdateGUI() { // update the player Fund lblMoney.Text = String.Format("{0:C}", Blackjack.PlayerFunds); // -- Player Hand 1 // update the Card -- Show the Card in the Table DisplayHand(Blackjack.PlayerHands[0], tblPlayerHand1, true); // Update the Player Info lblPlayerInfo1.Text = String.Format("Bet: {0:C} Score: {1}", Blackjack.PlayerHands[0].Bet, Blackjack.PlayerHands[0].Score); // Player 1 Update the Button SetButtonEnable(btnHitPlayerHand1, Blackjack.CanHit(0)); SetButtonEnable(btnDoublePlayerHand1, Blackjack.CanDouble(0)); SetButtonEnable(btnStandPlayerHand1, Blackjack.CanStand(0)); SetButtonEnable(btnSurrenderPlayerHand1, Blackjack.CanSurrender()); SetButtonEnable(btnSplitPlayerHand1, Blackjack.CanSplit()); // -- Player hand 2 if (Blackjack.PlayerHands.Count == 2) { // update the Card -- Show the Card in the Table DisplayHand(Blackjack.PlayerHands[1], tblPlayerHand2, true); // update the player Info lblPlayerInfo2.Text = String.Format("Bet: {0:C} Score: {1}", Blackjack.PlayerHands[1].Bet, Blackjack.PlayerHands[1].Score); // update the button SetButtonEnable(btnDoublePlayerHand2, Blackjack.CanDouble(1)); SetButtonEnable(btnHitPlayerHand2, Blackjack.CanHit(1)); SetButtonEnable(btnStandPlayerHand2, Blackjack.CanStand(1)); } // deal button update to Enable SetButtonEnable(btnDeal, !Blackjack.CanPlayerPlay()); }