Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();

            dogs[0] = new Greyhound()
            {
                MyPictureBox = dog1,
                Randomizer = distance,
                numOfDog = 1,
            };
            dogs[1] = new Greyhound()
            {
                MyPictureBox = dog2,
                Randomizer = distance,
                numOfDog = 2,
            };
            dogs[2] = new Greyhound()
            {
                MyPictureBox = dog3,
                Randomizer = distance,
                numOfDog = 3,
            };
            dogs[3] = new Greyhound()
            {
                MyPictureBox = dog4,
                Randomizer = distance,
                numOfDog = 4,
            };

            guys[0] = new Guy()
            {
                MyRadioButton = radioButton1,
                MyLabel = joesBet,
                Name = "Joe",
                Cash = 6,
            };
            guys[1] = new Guy()
            {
                MyRadioButton = radioButton2,
                MyLabel = bobsBet,
                Name = "Bob",
                Cash = 75
            };
            guys[2] = new Guy()
            {
                MyRadioButton = radioButton3,
                MyLabel = aisBet,
                Name = "AI",
                Cash = 45,
            };

            label1.Text = "Minimum bet: " + (int)amount.Minimum + " bucks";
            radioButton1.Text = guys[0].Name + " has " + guys[0].Cash + " bucks";
            radioButton2.Text = guys[1].Name + " has " + guys[1].Cash + " bucks";
            radioButton3.Text = guys[2].Name + " has " + guys[2].Cash + " bucks";
        }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();
            guyArray[0] = new Guy() { Name = "Joe", Cash = 100, MyRadioButton = joeButton };
            guyArray[1] = new Guy() { Name = "Bob", Cash = 100, MyRadioButton = BobButton };
            guyArray[2] = new Guy() { Name = "Al", Cash = 100, MyRadioButton = alButton };

            //Guy Joe = guyArray[0];
            //Guy Bob = guyArray[1];
            //Guy Al = guyArray[2];

            greyArray[0] = new Greyhound() { StartingPosition = 0, RacetrackLength = RaceTrack.Image.Width, MyPictureBox = GreyHoundPicutre1, Location = 0 };
            greyArray[1] = new Greyhound() { StartingPosition = 0, RacetrackLength = RaceTrack.Image.Width, MyPictureBox = GreyHoundPicutre2, Location = 0 };
            greyArray[2] = new Greyhound() { StartingPosition = 0, RacetrackLength = RaceTrack.Image.Width, MyPictureBox = GreyHoundPicutre3, Location = 0 };
            greyArray[3] = new Greyhound() { StartingPosition = 0, RacetrackLength = RaceTrack.Image.Width, MyPictureBox = GreyHoundPicutre4, Location = 0 };
        }
Esempio n. 3
0
        public void InitializeForm()
        {
            GreyhoundArray[0] = new Greyhound()
            {
                MyPictureBox     = pictureBox1,
                StartingPosition = pictureBox1.Left,
                RaceTrackLength  = racetrackPictureBox.Width - pictureBox1.Width,
                Randomizer       = MyRandomizer
            };

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

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

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

            GuyArray[0] = new Guy()
            {
                Name          = "Joe",
                Cash          = 50,
                MyBet         = null,
                MyRadioButton = joeRadioButton,
                MyLabel       = joeBetLabel
            };

            GuyArray[1] = new Guy()
            {
                Name          = "Bob",
                Cash          = 75,
                MyBet         = null,
                MyRadioButton = bobRadioButton,
                MyLabel       = bobBetLabel
            };

            GuyArray[2] = new Guy()
            {
                Name          = "Al",
                Cash          = 45,
                MyBet         = null,
                MyRadioButton = alRadioButton,
                MyLabel       = alBetLabel
            };

            GuyArray[0].UpdateLabels();
            GuyArray[1].UpdateLabels();
            GuyArray[2].UpdateLabels();

            minimumBetLabel.Text = "Minimum Bet: " + betNumber.Minimum + " bucks";
        }
Esempio n. 4
0
        public Form1()
        {
            InitializeComponent();

            //Initialising our greyhound array
            greyHoundArray[0] = new Greyhound()
            {
                MyPictureBox     = greyhoundPB1,
                StartingPosition = greyhoundPB1.Left,
                RaceTrackLength  = racetrackPB.Width - greyhoundPB1.Width,
                Randomizer       = MyRandomizer
            };
            greyHoundArray[1] = new Greyhound()
            {
                MyPictureBox     = greyhoundPB2,
                StartingPosition = greyhoundPB2.Left,
                RaceTrackLength  = racetrackPB.Width - greyhoundPB2.Width,
                Randomizer       = MyRandomizer
            };
            greyHoundArray[2] = new Greyhound()
            {
                MyPictureBox     = greyhoundPB3,
                StartingPosition = greyhoundPB3.Left,
                RaceTrackLength  = racetrackPB.Width - greyhoundPB3.Width,
                Randomizer       = MyRandomizer
            };
            greyHoundArray[3] = new Greyhound()
            {
                MyPictureBox     = greyhoundPB4,
                StartingPosition = greyhoundPB4.Left,
                RaceTrackLength  = racetrackPB.Width - greyhoundPB4.Width,
                Randomizer       = MyRandomizer
            };

            //Initialising our Guy Array
            guyArray[0] = new Guy()
            {
                Cash          = 50,
                Name          = "Joe",
                myLabel       = joeBetLabel,
                myRadioButton = joeRadioButton
            };
            guyArray[1] = new Guy()
            {
                Cash          = 50,
                Name          = "Bob",
                myLabel       = bobBetLabel,
                myRadioButton = bobRadioButton
            };
            guyArray[2] = new Guy()
            {
                Cash          = 50,
                Name          = "Al",
                myLabel       = alBetLabel,
                myRadioButton = alRadioButton
            };

            minBetlabel.Text   = "Minimum Bet:" + betsNumUD.Minimum;
            nameTextLabel.Text = "Joe";
            guyArray[0].UpdateLabels();
            guyArray[1].UpdateLabels();
            guyArray[2].UpdateLabels();
        }
Esempio n. 5
0
        public Form1()
        {
            InitializeComponent();

            dogs[0] = new Greyhound()
            {
                MyPictureBox = greyHound1,
                StartingPosition = greyHound1.Left,
                RacetrackLength = raceTrack.Width - greyHound1.Width,
                Randomizer = MyRandomizer
            };

            dogs[1] = new Greyhound()
            {
                MyPictureBox = greyHound2,
                StartingPosition = greyHound2.Left,
                RacetrackLength = raceTrack.Width - greyHound2.Width,
                Randomizer = MyRandomizer
            };

            dogs[2] = new Greyhound()
            {
                MyPictureBox = greyHound3,
                StartingPosition = greyHound3.Left,
                RacetrackLength = raceTrack.Width - greyHound3.Width,
                Randomizer = MyRandomizer
            };

            dogs[3] = new Greyhound()
            {
                MyPictureBox = greyHound4,
                StartingPosition = greyHound4.Left,
                RacetrackLength = raceTrack.Width - greyHound4.Width,
                Randomizer = MyRandomizer
            };

            guys[0] = new Guy()
            {
                MyLabel = joeBetLabel,
                Name = "Joe",
                Cash = 50,
                MyBet = new Bet(),
                MyRadioButton = joeRadioButton
            };

            guys[1] = new Guy()
            {
                MyLabel = bobBetLabel,
                Name = "Bob",
                Cash = 75,
                MyBet = new Bet(),
                MyRadioButton = bobRadioButton
            };

            guys[2] = new Guy()
            {
                MyLabel = alBetLabel,
                Name = "Al",
                Cash = 45,
                MyBet = new Bet(),
                MyRadioButton = alRadioButton
            };
        }
Esempio n. 6
0
        public Form1()
        {
            InitializeComponent();

            dogs[0] = new Greyhound()
            {
                MyPictureBox     = greyHound1,
                StartingPosition = greyHound1.Left,
                RacetrackLength  = raceTrack.Width - greyHound1.Width,
                Randomizer       = MyRandomizer
            };

            dogs[1] = new Greyhound()
            {
                MyPictureBox     = greyHound2,
                StartingPosition = greyHound2.Left,
                RacetrackLength  = raceTrack.Width - greyHound2.Width,
                Randomizer       = MyRandomizer
            };

            dogs[2] = new Greyhound()
            {
                MyPictureBox     = greyHound3,
                StartingPosition = greyHound3.Left,
                RacetrackLength  = raceTrack.Width - greyHound3.Width,
                Randomizer       = MyRandomizer
            };

            dogs[3] = new Greyhound()
            {
                MyPictureBox     = greyHound4,
                StartingPosition = greyHound4.Left,
                RacetrackLength  = raceTrack.Width - greyHound4.Width,
                Randomizer       = MyRandomizer
            };

            guys[0] = new Guy()
            {
                MyLabel       = joeBetLabel,
                Name          = "Joe",
                Cash          = 50,
                MyBet         = new Bet(),
                MyRadioButton = joeRadioButton
            };

            guys[1] = new Guy()
            {
                MyLabel       = bobBetLabel,
                Name          = "Bob",
                Cash          = 75,
                MyBet         = new Bet(),
                MyRadioButton = bobRadioButton
            };

            guys[2] = new Guy()
            {
                MyLabel       = alBetLabel,
                Name          = "Al",
                Cash          = 45,
                MyBet         = new Bet(),
                MyRadioButton = alRadioButton
            };
        }
        public Form1()
        {
            InitializeComponent();
            GreyhoundArray[0] = new Greyhound()
            {
                MyPictureBox        = pictureBox1,
                StartingPosition    = 0,
                RacetrackPictureBox = racetrackPictureBox,
                RacetrackLength     = racetrackPictureBox.Width - pictureBox1.Width,
                Randomizer          = MyRandomizer
            };
            GreyhoundArray[1] = new Greyhound()
            {
                MyPictureBox        = pictureBox2,
                RacetrackPictureBox = racetrackPictureBox,
                RacetrackLength     = racetrackPictureBox.Width - pictureBox2.Width,
                Randomizer          = MyRandomizer
            };
            GreyhoundArray[2] = new Greyhound()
            {
                MyPictureBox        = pictureBox3,
                RacetrackPictureBox = racetrackPictureBox,
                RacetrackLength     = racetrackPictureBox.Width - pictureBox3.Width,
                Randomizer          = MyRandomizer
            };
            GreyhoundArray[3] = new Greyhound()
            {
                MyPictureBox        = pictureBox4,
                RacetrackPictureBox = racetrackPictureBox,
                RacetrackLength     = racetrackPictureBox.Width - pictureBox4.Width,
                Randomizer          = MyRandomizer
            };

            GuyArray[0] = new Guy()
            {
                Name          = "Joe",
                Cash          = 50,
                MyLabel       = joeBetlabel,
                MyRadioButton = joeRadioButton
            };

            GuyArray[0].MyBet = new Bet()
            {
                Bettor = GuyArray[0],
                Amount = 0,
                Dog    = (int)dogNumber.Value
            };

            GuyArray[1] = new Guy()
            {
                Name          = "Bob",
                Cash          = 75,
                MyLabel       = bobBetLabel,
                MyRadioButton = bobRadioButton
            };
            GuyArray[1].MyBet = new Bet()
            {
                Bettor = GuyArray[1],
                Amount = 0,
                Dog    = (int)dogNumber.Value
            };
            GuyArray[2] = new Guy()
            {
                Name          = "Al",
                Cash          = 45,
                MyLabel       = alBetLabel,
                MyRadioButton = alRadioButton
            };
            GuyArray[2].MyBet = new Bet()
            {
                Bettor = GuyArray[2],
                Amount = 0,
                Dog    = (int)dogNumber.Value
            };
        }
Esempio n. 8
0
        public Form1()
        {
            InitializeComponent();

            guys[0] = new Guy()
            {
                Name          = "Joe",
                Cash          = 50,
                MyRadioButton = joeRadioButton,
                MyLabel       = joeLabel
            };
            guys[0].PlaceBet(0, 0);
            guys[0].UpdateLabels();
            guys[1] = new Guy()
            {
                Name          = "Bob",
                Cash          = 75,
                MyRadioButton = bobRadioButton,
                MyLabel       = bobLabel
            };
            guys[1].PlaceBet(0, 0);
            guys[1].UpdateLabels();
            guys[2] = new Guy()
            {
                Name          = "Al",
                Cash          = 45,
                MyRadioButton = alRadioButton,
                MyLabel       = alLabel
            };
            guys[2].PlaceBet(0, 0);
            guys[2].UpdateLabels();

            dogs[0] = new Greyhound()
            {
                StartingPosition = dog1PictureBox.Location.X,
                MyPictureBox     = dog1PictureBox,
                RacetrackLength  = dog1PictureBox.Location.X + raceTrackPictureBox.Width
            };
            dogs[1] = new Greyhound()
            {
                StartingPosition = dog2PictureBox.Location.X,
                MyPictureBox     = dog2PictureBox,
                RacetrackLength  = dog2PictureBox.Location.X + raceTrackPictureBox.Width
            };
            dogs[2] = new Greyhound()
            {
                StartingPosition = dog3PictureBox.Location.X,
                MyPictureBox     = dog3PictureBox,
                RacetrackLength  = dog3PictureBox.Location.X + raceTrackPictureBox.Width
            };
            dogs[3] = new Greyhound()
            {
                StartingPosition = dog4PictureBox.Location.X,
                MyPictureBox     = dog4PictureBox,
                RacetrackLength  = dog4PictureBox.Location.X + raceTrackPictureBox.Width
            };
            //dogs[0].RacetrackLength = raceTrackPictureBox.ImageLocation.Length;
            //dogs[1].RacetrackLength = raceTrackPictureBox.ImageLocation.Length;
            //dogs[2].RacetrackLength = raceTrackPictureBox.ImageLocation.Length;
            //dogs[3].RacetrackLength = raceTrackPictureBox.ImageLocation.Length;

            minLabel.Text = "Minimum bet: " + betsNumericUD.Minimum + " bucks";
            minLabel.Update();
        }