Guest User

Guy.cs

a guest
Jun 15th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7.  
  8. namespace BetDogsHeadFirst
  9. {
  10. public class Guy
  11. {
  12. public string name;
  13. public Bet myBet;
  14. public int cash;
  15. public RadioButton myRadioButton;
  16. public Label myLabel;
  17.  
  18. public void UpdateLabels()
  19. {
  20. myRadioButton.Text = name + " has " + cash + " bucks.";
  21. if(myBet==null)
  22. {
  23. myLabel.Text = name + " hasn't place a bet";
  24. }
  25. else
  26. {
  27. myLabel.Text = myBet.GetDescription();
  28. }
  29.  
  30. }
  31. public void ResetBet()
  32. {
  33. myBet.amount = 0;
  34. }
  35. public bool PlaceBet(int betAmount,int DogToWin)
  36. {
  37. if (cash >= betAmount)
  38. {
  39. myBet = new Bet() { amount = betAmount, dog = DogToWin, bettor = this };
  40. return true;
  41. }
  42. else
  43. return false;
  44. }
  45. public void Collect(int winner)
  46. {
  47. cash += myBet.PayOut(winner);
  48. }
  49. }
  50. }
Add Comment
Please, Sign In to add comment