Example #1
0
        public Form1()
        {
            InitializeComponent();

            ghs[0] = new Greyhound();
            ghs[1] = new Greyhound();
            ghs[2] = new Greyhound();
            ghs[3] = new Greyhound();

            ghs[0].myPBox = dog1;
            ghs[1].myPBox = dog2;
            ghs[2].myPBox = dog3;
            ghs[3].myPBox = dog4;

            Random ranall = new Random();
            ghs[0].Randomizer = ranall;
            ghs[1].Randomizer = ranall;
            ghs[2].Randomizer = ranall;
            ghs[3].Randomizer = ranall;

            players[0] = new Players();
            players[1] = new Players();
            players[2] = new Players();

            players[0].Name = "Joe";
            players[1].Name = "Bob";
            players[2].Name = "Alice";

            players[0].Cash = 50;
            players[1].Cash = 75;
            players[2].Cash = 45;

            players[0].whichPlayer = Joe;
            players[1].whichPlayer = Bob;
            players[2].whichPlayer = Alice;

            players[0].BetDescription = JoeBet;
            players[1].BetDescription = BobBet;
            players[2].BetDescription = AliceBet;

            players[0].MyBet = null;
            players[1].MyBet = null;
            players[2].MyBet = null;
        }
Example #2
0
        public Form1()
        {
            InitializeComponent();


            Dogs    = new Greyhound[4];
            Dogs[0] = new Greyhound()
            {
                MyPictureBox    = pictureBox2,
                StartingPostion = pictureBox2.Left,
                RacetrackLength = raceTrack.Width - pictureBox2.Width,
                Randomizer      = new Random()
            };
            Dogs[1] = new Greyhound()
            {
                MyPictureBox    = pictureBox3,
                StartingPostion = pictureBox3.Left,
                RacetrackLength = raceTrack.Width - pictureBox3.Width,
                Randomizer      = new Random()
            };
            Dogs[2] = new Greyhound()
            {
                MyPictureBox    = pictureBox4,
                StartingPostion = pictureBox4.Left,
                RacetrackLength = raceTrack.Width - pictureBox4.Width,
                Randomizer      = new Random()
            };
            Dogs[3] = new Greyhound()
            {
                MyPictureBox    = pictureBox5,
                StartingPostion = pictureBox5.Left,
                RacetrackLength = raceTrack.Width - pictureBox5.Width,
                Randomizer      = new Random()
            };


            Guys    = new Guy[3];
            Guys[0] = new Guy()
            {
                Name          = "Joe",
                Cash          = 50,
                MyRadioButton = joeRadioButton,
                MyLabel       = joeBetLabel
            };
            Guys[1] = new Guy()
            {
                Name          = "Bob",
                Cash          = 50,
                MyRadioButton = bobRadioButton,
                MyLabel       = bobBetLabel
            };
            Guys[2] = new Guy()
            {
                Name          = "Al",
                Cash          = 50,
                MyRadioButton = alRadioButton,
                MyLabel       = alBetLabel
            };

            minimumBetLabel.Text = "Minimum bet: " + betsNumeri.Minimum + "bucks";

            for (int i = 0; i < 3; i++)
            {
                Guys[i].MyRadioButton.Text = Guys[i].Name + " has " + Guys[i].Cash + " bucks";
                Guys[i].MyLabel.Text       = Guys[i].Name + " hasn't placed a bet";
            }
        }