// Bet Mybet = new Bet(); public Form1() { InitializeComponent(); dogsArray[0] = new Greyhound() { MyPictureBox = pictureBox1, Name = "Day Break", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox1.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1,3), oddsAgainst = Randomizer.Next(2,8) }; dogsArray[1] = new Greyhound() { MyPictureBox = pictureBox2, Name = "Lightning's Revenge", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox2.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1, 3), oddsAgainst = Randomizer.Next(2,14) }; dogsArray[2] = new Greyhound() { MyPictureBox = pictureBox3, Name = "Mytosis", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox3.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1, 3), oddsAgainst = Randomizer.Next(2, 12) }; dogsArray[3] = new Greyhound() { MyPictureBox = pictureBox4, Name = "Sleeping Sycamore", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox4.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1, 3), oddsAgainst = Randomizer.Next(2, 10) }; guyArray[0] = new Guy() { MyBet = null, Name = "Zack", Cash = 50, MyLabel = lblZack, MyRadioButton = rdbtnZack, MyLabel2 = lblZackBet }; guyArray[1] = new Guy() { MyBet = null, Name = "Nick", Cash = 75, MyLabel = lblNick, MyRadioButton = rdbtnNick, MyLabel2 = lblNickBet }; guyArray[2] = new Guy() { MyBet = null, Name = "Taylor", Cash = 45, MyLabel = lblTaylor, MyRadioButton = rdbtnTaylor, MyLabel2 = lblTaylorBet }; guyArray[0].UpdateLabels(); guyArray[1].UpdateLabels(); guyArray[2].UpdateLabels(); if (dogsArray[0].oddsFor.ToString() == dogsArray[0].oddsAgainst.ToString()) lblDBOdds.Text = "Even"; else lblDBOdds.Text = dogsArray[0].oddsAgainst.ToString() + " : " + dogsArray[0].oddsFor.ToString(); if (dogsArray[1].oddsFor.ToString() == dogsArray[1].oddsAgainst.ToString()) LROdds.Text = "Even"; else LROdds.Text = dogsArray[1].oddsAgainst.ToString() + " : " + dogsArray[1].oddsFor.ToString(); if (dogsArray[2].oddsFor.ToString() == dogsArray[2].oddsAgainst.ToString()) MOdds.Text = "Even"; else MOdds.Text = dogsArray[2].oddsAgainst.ToString() + " : " + dogsArray[2].oddsFor.ToString(); if (dogsArray[3].oddsFor.ToString() == dogsArray[3].oddsAgainst.ToString()) SSOdds.Text = "Even"; else SSOdds.Text = dogsArray[3].oddsAgainst.ToString() + " : " + dogsArray[3].oddsFor.ToString(); }
private void Form1_OnLoad(object sender, EventArgs e) { guys[0] = new Guy("Joe", 50, JoeLabel, JoeRadio); guys[1] = new Guy("Al", 75, AlLabel, AlRadio); guys[2] = new Guy("Bob", 45, BobLabel, BobRadio); guys[0].UpdateLabels(); guys[1].UpdateLabels(); guys[2].UpdateLabels(); Random ran = new Random(); dogs[0] = new Greyhound(Dog1, ran); dogs[1] = new Greyhound(Dog2, ran); dogs[2] = new Greyhound(Dog3, ran); dogs[3] = new Greyhound(Dog4, ran); }
// Bet Mybet = new Bet(); public Form1() { InitializeComponent(); dogsArray[0] = new Greyhound() { MyPictureBox = pictureBox1, Name = "Day Break", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox1.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1, 3), oddsAgainst = Randomizer.Next(2, 8) }; dogsArray[1] = new Greyhound() { MyPictureBox = pictureBox2, Name = "Lightning's Revenge", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox2.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1, 3), oddsAgainst = Randomizer.Next(2, 14) }; dogsArray[2] = new Greyhound() { MyPictureBox = pictureBox3, Name = "Mytosis", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox3.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1, 3), oddsAgainst = Randomizer.Next(2, 12) }; dogsArray[3] = new Greyhound() { MyPictureBox = pictureBox4, Name = "Sleeping Sycamore", RaceTrackLength = racetrackPictureBox.Width - pictureBox1.Width, StartingPosition = pictureBox4.Left, Randomizer = Randomizer, oddsFor = Randomizer.Next(1, 3), oddsAgainst = Randomizer.Next(2, 10) }; guyArray[0] = new Guy() { MyBet = null, Name = "Zack", Cash = 50, MyLabel = lblZack, MyRadioButton = rdbtnZack, MyLabel2 = lblZackBet }; guyArray[1] = new Guy() { MyBet = null, Name = "Nick", Cash = 75, MyLabel = lblNick, MyRadioButton = rdbtnNick, MyLabel2 = lblNickBet }; guyArray[2] = new Guy() { MyBet = null, Name = "Taylor", Cash = 45, MyLabel = lblTaylor, MyRadioButton = rdbtnTaylor, MyLabel2 = lblTaylorBet }; guyArray[0].UpdateLabels(); guyArray[1].UpdateLabels(); guyArray[2].UpdateLabels(); if (dogsArray[0].oddsFor.ToString() == dogsArray[0].oddsAgainst.ToString()) { lblDBOdds.Text = "Even"; } else { lblDBOdds.Text = dogsArray[0].oddsAgainst.ToString() + " : " + dogsArray[0].oddsFor.ToString(); } if (dogsArray[1].oddsFor.ToString() == dogsArray[1].oddsAgainst.ToString()) { LROdds.Text = "Even"; } else { LROdds.Text = dogsArray[1].oddsAgainst.ToString() + " : " + dogsArray[1].oddsFor.ToString(); } if (dogsArray[2].oddsFor.ToString() == dogsArray[2].oddsAgainst.ToString()) { MOdds.Text = "Even"; } else { MOdds.Text = dogsArray[2].oddsAgainst.ToString() + " : " + dogsArray[2].oddsFor.ToString(); } if (dogsArray[3].oddsFor.ToString() == dogsArray[3].oddsAgainst.ToString()) { SSOdds.Text = "Even"; } else { SSOdds.Text = dogsArray[3].oddsAgainst.ToString() + " : " + dogsArray[3].oddsFor.ToString(); } }