public void UpdateLabels() { if (MyBet != null) { MyLabel.Text = MyBet.GetDescription(); } MyRadioButton.Text = Name + " has " + Cash + " bucks"; }
public Label MyLabel; //My Label public void UpdateLabels() { //Set my label to my bet's description, and the label on my //radio button to show my cash ("Joe has 43 bucks") MyRadioButton.Text = Name + " has " + Cash + " bucks"; if (MyBet != null) { MyLabel.Text = MyBet.GetDescription(); } }
/// <summary> /// Updates GUI labels. /// </summary> public void UpdateLabel() { MyRadioButton.Text = Name + " has £" + Cash; if (MyBet != null) { MyLabel.Text = MyBet.GetDescription(); } else { MyLabel.Text = Name + " hasn't placed a bet"; } }
public bool PlaceBet(int BetAmount, int DogToWin) { if (Cash > BetAmount) { MyBet = new Bet() { Amount = BetAmount, Dog = DogToWin, Bettor = this }; MyLabel.Text = MyBet.GetDescription(); return true; } else { return false; } // Place a new bet and store it in my bet field // Return true if the guy had enough money to start }
public void UpdateLabels() { MyLabel.Text = MyBet.GetDescription(this); MyRadioButton.Text = $@"{Name} has ${Cash} dollars"; }