예제 #1
0
        public void SetupGreyhounds()
        {
            greyhounds[0] = new Greyhound(pbDog0, pbRaceTrack.Width);
            greyhounds[1] = new Greyhound(pbDog1, pbRaceTrack.Width);
            greyhounds[2] = new Greyhound(pbDog2, pbRaceTrack.Width);
            greyhounds[3] = new Greyhound(pbDog3, pbRaceTrack.Width);

            for (int i = 0; i < greyhounds.Count(); i++)
            {
                cbxDog.Items.Add(i+1);
            }
        }
예제 #2
0
        public Form1()
        {
            InitializeComponent();
            Random MyRandomizer = new Random();

            GreyhoundArray[0] = new Greyhound()
            {
                MyPictureBox     = pictureBox1,
                StartingPosition = pictureBox1.Left,
                RaceTrackLength  = 400,
                Randomizer       = MyRandomizer
            };

            GreyhoundArray[1] = new Greyhound()
            {
                MyPictureBox     = pictureBox2,
                StartingPosition = pictureBox2.Left,
                RaceTrackLength  = 400,
                Randomizer       = MyRandomizer
            };

            GreyhoundArray[2] = new Greyhound()
            {
                MyPictureBox     = pictureBox3,
                StartingPosition = pictureBox3.Left,
                RaceTrackLength  = 400,
                Randomizer       = MyRandomizer
            };

            GreyhoundArray[3] = new Greyhound()
            {
                MyPictureBox     = pictureBox4,
                StartingPosition = pictureBox4.Left,
                RaceTrackLength  = 400,
                Randomizer       = MyRandomizer
            };

            GuyArray[0] = new Guy()
            {
                Name          = "joe",
                Cash          = 10,
                MyLabel       = label2,
                MyRadioButton = radioButton1
            };

            GuyArray[1] = new Guy()
            {
                Name          = "bob",
                Cash          = 10,
                MyLabel       = label3,
                MyRadioButton = radioButton2
            };

            GuyArray[2] = new Guy()
            {
                Name          = "al",
                Cash          = 10,
                MyLabel       = label4,
                MyRadioButton = radioButton3
            };
        }