Beispiel #1
0
 public Manager(List<PictureBox> pictureBoxes, ListBox display)
 {
     this.pictureBoxes = pictureBoxes;
     rGen = new Random();
     this.display = display;
     continent = null;
 }
Beispiel #2
0
        public Form1()
        {
            InitializeComponent();

            Random randomGenerator = new Random();
            canvas = CreateGraphics();

            australia = new Australia(displayListBox, randomGenerator, canvas);
            northAmerica = new NorthAmerica(displayListBox, randomGenerator, canvas);
            africa = new Africa(displayListBox, randomGenerator, canvas);
        }
Beispiel #3
0
        public Form1()
        {
            InitializeComponent();

            //instantiate a canvas
            canvas = this.CreateGraphics();

            //Instantiate continents
            na = new NorthAmerica(lbDisplayBox, rGen, ANIMAL_TYPE_COUNT, canvas);
            au = new Australia(lbDisplayBox, rGen, ANIMAL_TYPE_COUNT, canvas);
            an = new Antarctica(lbDisplayBox, rGen, ANIMAL_TYPE_COUNT, canvas);
        }
Beispiel #4
0
        public void runSimulation(Continent newContinent)
        {
            //set the new continent
            continent = newContinent;
            // get a list of animals from the continent
            List<Animal> animals = continent.getAnimalList();

            //for each animal set a set the picturebox and list box
            for(int i = 0; i < animals.Count; i++)
            {
                pictureBoxes[i].Image = animals[i].Image;
                display.Items.Add(animals[i].ToString());
            }
        }
Beispiel #5
0
 private void btn_Africa_Click(object sender, EventArgs e)
 {
     lb_Display.Items.Clear();
     continent = new Africa(rGen, 4);
     manager.runSimulation(continent);
 }
Beispiel #6
0
 //each button creates a new continent and calls the managers run simulation
 private void button1_Click(object sender, EventArgs e)
 {
     lb_Display.Items.Clear();
     continent = new NorthAmerica(rGen, 4);
     manager.runSimulation(continent);
 }
Beispiel #7
0
 //each button creates a new continent and calls the managers run simulation
 private void button1_Click(object sender, EventArgs e)
 {
     lb_Display.Items.Clear();
     continent = new NorthAmerica(rGen, 4);
     manager.runSimulation(continent);
 }
Beispiel #8
0
 private void btn_Australia_Click(object sender, EventArgs e)
 {
     lb_Display.Items.Clear();
     continent = new Australia(rGen, 4);
     manager.runSimulation(continent);
 }