Пример #1
0
        /// <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);
        }