Example #1
0
 /// <summary>
 /// The RemoveLastChip method is called to remove the last chip placed on the bet.
 /// </summary>
 public void RemoveLastChip()
 {
     try
     {
         if (Chips.Count > 0)
         {
             Chip chip = Chips[Chips.Count - 1];     // Retrieve the last chip.
             BetAmount = BetAmount - chip.Value;     // Update the bet amount.
             OnBetPlaced?.Invoke(-1 * chip.Value);   // Notify that the last chip as been removed (place a negative bet).
             Chips.RemoveAt(Chips.Count - 1);        // Remove the last chip from the bet.
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Bet.RemoveLastChip(): " + ex.ToString());
     }
 }