コード例 #1
0
ファイル: MainForm.cs プロジェクト: BSprong/Simulatie
        private void startSimulatieToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            SettingsForm sf = new SettingsForm();

            sf.ShowDialog();

            if (sf.DialogResult == DialogResult.OK)
            {
                ILifeSimulation simulation = new LifeSimulation.LifeSimulation(LifeApplication.Layouts[0], sf.nElements, LifeApplication.GetSpecies(), sf.plants, sf.carnivores, sf.herbivores, sf.omnivores, sf.nonivores, sf.obstacles, 100);

                LifeApplication.AddSimulation(simulation);


                SimulationForm simForm = new SimulationForm(simulation);
                simForm.MdiParent = this;
                simForm.Show();
            }
        }
コード例 #2
0
        private void startSimulatieToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            SettingsForm sf = new SettingsForm();

            sf.ShowDialog();

            if (sf.DialogResult == DialogResult.OK)
            {
                // TODO INITEN MET GOEDE WAARDEN
                ILifeSimulation simulation = new LifeSimulation.LifeSimulation(LifeApplication.Layouts[0], sf.nElements, LifeApplication.GetSpecies(), sf.plants, sf.carnivores, sf.herbivores, sf.omnivores, sf.nonivores, sf.obstacles, 100);
                // Toevoegen aan mainForm
                LifeApplication.AddSimulation(simulation);

                // Nieuw formulier maken en simulation meesturen.
                SimulationForm simForm = new SimulationForm(simulation);
                simForm.MdiParent = this;
                simForm.Show();
            }
        }