示例#1
0
        public Form1()
        {
            InitializeComponent();
            int raceTrack = background.Size.Width;

            Console.WriteLine(raceTrack.ToString());

            greyhoundArray = new List <Greyhound>();

            greyhoundArray.Add(jackson = new Greyhound()
            {
                pictureBox = jacksonDog, raceTrackLength = raceTrack
            });
            greyhoundArray.Add(hagan = new Greyhound()
            {
                pictureBox = haganDog, raceTrackLength = raceTrack
            });
            greyhoundArray.Add(harry = new Greyhound()
            {
                pictureBox = harryDog, raceTrackLength = raceTrack
            });
            greyhoundArray.Add(fender = new Greyhound()
            {
                pictureBox = fenderDog, raceTrackLength = raceTrack
            });

            bookersArray           = new List <Booker>();
            bookersArray.Add(janek = new Booker()
            {
                name = "Janek", cash = 100, myLabel = janekLabel, myRadioButton = janekButton, description = janekDescription
            });
            bookersArray.Add(ignacy = new Booker()
            {
                name = "Ignacy", cash = 210, myLabel = ignacyLabel, myRadioButton = ignacyButton, description = ignacyDescription
            });
            bookersArray.Add(piotrek = new Booker()
            {
                name = "Piotrek", cash = 143, myLabel = piotrekLabel, myRadioButton = piotrekButton, description = piotrekDescription
            });

            //wyświetlenie incjalnych labelek :)
            foreach (Booker guy in bookersArray)
            {
                guy.updateLabels();
                guy.firstDescription();
            }
        }
示例#2
0
        private void betButton_Click(object sender, EventArgs e)
        {
            int indexOfBooker = 0;

            switch (activeBooker.Text)
            {
            case "Janek":
                indexOfBooker = 0;
                break;

            case "Ignacy":
                indexOfBooker = 1;
                break;

            case "Piotrek":
                indexOfBooker = 2;
                break;
            }

            Booker help = bookersArray[indexOfBooker];

            help.placeBet((int)betAmount.Value, (int)dogNumber.Value);
            help.updateLabels();
        }
示例#3
0
        public Form1()
        {
            InitializeComponent();
            int raceTrack = background.Size.Width;
            Console.WriteLine(raceTrack.ToString());

            greyhoundArray = new List<Greyhound>();

            greyhoundArray.Add(jackson = new Greyhound() { pictureBox = jacksonDog, raceTrackLength = raceTrack });
            greyhoundArray.Add(hagan = new Greyhound() { pictureBox = haganDog, raceTrackLength = raceTrack });
            greyhoundArray.Add(harry = new Greyhound() { pictureBox = harryDog, raceTrackLength = raceTrack });
            greyhoundArray.Add(fender = new Greyhound() { pictureBox = fenderDog, raceTrackLength = raceTrack });

            bookersArray = new List<Booker>();
            bookersArray.Add(janek = new Booker() { name = "Janek", cash = 100, myLabel = janekLabel, myRadioButton = janekButton, description = janekDescription });
            bookersArray.Add(ignacy = new Booker() { name = "Ignacy", cash = 210, myLabel = ignacyLabel, myRadioButton = ignacyButton, description = ignacyDescription });
            bookersArray.Add(piotrek = new Booker() { name = "Piotrek", cash = 143, myLabel = piotrekLabel, myRadioButton = piotrekButton, description = piotrekDescription });

            //wyświetlenie incjalnych labelek :)
            foreach (Booker guy in bookersArray) {
                guy.updateLabels();
                guy.firstDescription();
            }
        }