public BugRacerForm() { InitializeComponent(); bugsTotalScoresLabels = new Label[] { label11, label14, label17, label20 }; bugsChanceLabels = new Label[] { label10, label13, label16, label19 }; gamblerMoneysLabels = new Label[] { label23,label6,label25}; bugs = new List<Bug>(); bugs.Add(new Bug("Участник 1",1, 585, pictureBox1,8)); bugs.Add(new Bug("Участник 2",2, 585, pictureBox2,6)); bugs.Add(new Bug("Участник 3", 3, 585, pictureBox3,7)); bugs.Add(new Bug("Участник 4", 4, 585, pictureBox4,5)); Random n=new Random(); gamblers = new List<Gambler>(); gamblers.Add(new Gambler("Игрок 1", 1,n.Next(250,1000) )); gamblers.Add(new Gambler("Игрок 2", 2, n.Next(250, 1000))); gamblers.Add(new Gambler("Игрок 3", 3, n.Next(250, 1000))); currentGambler = gamblers[0]; currentBug = bugs[0]; bets = new Dictionary<Gambler, Bet>(); controller = new GameController(bugs, gamblers); controller.finish += HandleFinishEvent; start += controller.OnStart; timer1.Tick += controller.OnTimer; timer1.Enabled = false; timer1.Interval = GAME_SPEED; UpdateInfo(); }
private void CurrentGamblerChanged(object sender, EventArgs e) { if (radioButton1.Checked) currentGambler = gamblers[0]; else if (radioButton2.Checked) currentGambler = gamblers[1]; else if (radioButton3.Checked) currentGambler = gamblers[2]; }
public Bet(Gambler gambler, Bug bug, int amount) { Gambler = gambler; Bug = bug; Amount = amount; }