public Team GetLoser() { if (Winner.Equals(FirstTeam)) { return(SecondTeam); } else { return(FirstTeam); } }
private void RevealCards(Winner winner) { this.panDealer.Controls.Clear(); this.panPlayer.Controls.Clear(); for (int i = 0; i < 5; i++) { var x = i * 60; var y = 0; var lblDealer = CreateCard(x, y, dealerHand.Cards[i]); var lblPlayer = CreateCard(x, y, playerHand.Cards[i]); this.panDealer.Controls.Add(lblDealer); this.panPlayer.Controls.Add(lblPlayer); } lblDealerHand.Text = dealerHand.HandValue.ToString(); lblPlayerHand.Text = playerHand.HandValue.ToString(); lblWinner.Text = String.Format("\t{0}", winner.Equals(Winner.Player) ? "Player wins!" : winner.Equals(Winner.Dealer) ? "Dealer wins!" : "It's a draw"); lblWinner.BackColor = winner.Equals(Winner.Player) ? Color.LightGreen : Color.LightPink; }