Exemplo n.º 1
0
 public Manager(List<PictureBox> pictureBoxes, ListBox display)
 {
     this.pictureBoxes = pictureBoxes;
     rGen = new Random();
     this.display = display;
     continent = null;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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());
            }
        }
Exemplo n.º 5
0
 private void btn_Africa_Click(object sender, EventArgs e)
 {
     lb_Display.Items.Clear();
     continent = new Africa(rGen, 4);
     manager.runSimulation(continent);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 8
0
 private void btn_Australia_Click(object sender, EventArgs e)
 {
     lb_Display.Items.Clear();
     continent = new Australia(rGen, 4);
     manager.runSimulation(continent);
 }