private void CreateNewGame(FormType formType) { FormForSelection selectorForm = new FormForSelection(formType); if (selectorForm.ShowDialog() == DialogResult.OK) { if (_game != null) { if (_timer != null) _timer.Stop(); _game = null; } try { _game = Game.Factory(selectorForm.ReturnFileName(), formType == FormType.GameConfiguration ? FactoryAct.Create : FactoryAct.Load, _graphObject); } catch { _game = null; } if (_game != null) { _game.Scaling = _currentScale; _gameMenu = null; MessageBox.Show("Game conf loaded successeful"); } if (_timer != null) _timer.Start(); } }
/// <summary> /// Creates the new game. /// </summary> /// <param name="formType">Type of the form.</param> private void CreateNewGame(FormType formType) { FormForSelection selectorForm = new FormForSelection(formType); if(selectorForm.ShowDialog() != DialogResult.OK) { return; } _game = null; try { _game = Game.Factory(selectorForm.ReturnFileName(), formType == FormType.GameConfiguration ? FactoryAct.Create : FactoryAct.Load, _graphObject); } catch { _game = null; } if(_game == null) { return; } _game.Scaling = _currentScale; _gameMenu = null; _graphObject.ClearCache(); MessageBox.Show(Resources.Game_created_successeful); }