private void Form1_Shown(object sender, EventArgs e) { Rows = (int)rowNumericUpDown.Value; Columns = (int)columnNumericUpDown.Value; Game = new ToroidalGameOfLife(Rows, Columns); //DrawGrid(Rows, Columns); renderPanel.Invalidate(); }
private void Form1_Shown(object sender, EventArgs e) { this.Text += $" - Signed in as \"{Username}\""; int rows = (int)rowNumericUpDown.Value; int columns = (int)columnNumericUpDown.Value; EnumerateSavegames(); GameTypeComboBox.SelectedIndex = 0; Game = new ToroidalGameOfLife(rows, columns); renderPictureBox.Invalidate(); }
private void LoadGameButton_Click(object sender, EventArgs e) { string selected = (string)SavegameListBox.SelectedItem; if (selected != null) { Savegame save = db.LoadSavegame(Username, selected); rowNumericUpDown.Value = save.Rows; columnNumericUpDown.Value = save.Columns; Game = ToroidalGameOfLife.Deserialise(save.Serialised, save.Rows, save.Columns); GameTypeComboBox.SelectedIndex = 0; ThresholdsChanged(sender, e); renderPictureBox.Invalidate(); } }
private void GameTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (Game != null) { ComboBox comboBox = sender as ComboBox; Game = GameTypes[comboBox.SelectedIndex](Game.AsArray()); if (comboBox.SelectedIndex != 3) { UnderpopulationThresholdUpDown.Enabled = false; RebirthThresholdUpDown.Enabled = false; OverpopulationThresholdUpDown.Enabled = false; } else { UnderpopulationThresholdUpDown.Enabled = true; RebirthThresholdUpDown.Enabled = true; OverpopulationThresholdUpDown.Enabled = true; } } }