/// <summary> /// Starts the game after validating user's informations /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btPlay_Click(object sender, EventArgs e) { Settings gameSettings = GetSettings(); // Checking if all settings are correct if (ValidateSettings()) { var formGame = new frmGame(gameSettings, CreatePlayers(gameSettings.PlayerCount)); this.Hide(); formGame.Closed += (s, args) => this.Close(); formGame.Show(); } else { MessageBox.Show("Some settings are missing !"); } }
private Player currentPlayer; // Store the player that is actually playing /// <summary> /// Constructor of GridMemory /// </summary> /// <param name="frmGameInstance">Instance of the game form</param> public GridMemory(frmGame gameInstance) { frmGameInstance = gameInstance; }