public menuForm() { InitializeComponent(); this.newAirplaneForm = new newAirplaneForm(); this.editAirplaneForm = new editAirplaneForm(); this.controllerAirplaneForm = new controllerAirplaneForm(); this.statsForm = new statsForm(); }
private void button_switchGameRunning_Click(object sender, EventArgs e) { this.game.switchGameRunning(); this.label_runningStatus.Text = this.game.getGameRunning() ? "ON" : "OFF"; if (this.game.getGameRunning()) { //if game is running, restart edit form this.editAirplaneForm.Dispose(); this.editAirplaneForm = new editAirplaneForm(this.game); } }
private void button_editAirplanes_Click(object sender, EventArgs e) { this.label_runningStatus.Text = this.game.getGameRunning() ? "ON" : "OFF"; if (!this.game.getGameRunning()) { if (this.game.getMap().getAirplanes().Count == 0) { MessageBox.Show("No airplanes on the map."); } else { this.editAirplaneForm.Dispose(); this.editAirplaneForm = new editAirplaneForm(this.game); this.editAirplaneForm.Show(); } } else { MessageBox.Show("Impossible to edit airplanes while simulation is running."); } }