private void OnChangeGameState(GameState state) { switch (state) { case GameState.Start: _mainMenuController = new MainMenuController(_placeForUi, _profilePlayer); _gameController?.Dispose(); _garageController?.Dispose(); _startFightController?.Dispose(); _fightWindowController?.Dispose(); break; case GameState.Garage: _garageController = new GarageController(_placeForUi, _profilePlayer, _inventoryModel); _mainMenuController?.Dispose(); _startFightController?.Dispose(); _fightWindowController?.Dispose(); break; case GameState.Game: _gameController = new GameController(_placeForUi, _profilePlayer); _startFightController = new StartFightController(_placeForUi, _profilePlayer); _mainMenuController?.Dispose(); _fightWindowController?.Dispose(); break; case GameState.Fight: _fightWindowController = new FightWindowController(_profilePlayer, _placeForUi); _mainMenuController?.Dispose(); _startFightController?.Dispose(); _gameController?.Dispose(); break; default: _mainMenuController?.Dispose(); _gameController?.Dispose(); _startFightController?.Dispose(); _fightWindowController?.Dispose(); break; } }
private void OnChangeGameState(GameState state) { switch (state) { case GameState.Start: _mainMenuController = new MainMenuController(_placeForUi, _profilePlayer); _gameController?.Dispose(); break; case GameState.Game: _gameController = new GameController(_placeForUi, _profilePlayer, new List <IItem>()); _startFightController = new StartFightController(_placeForUi, _startFightView, _profilePlayer); _startFightController.RefreshView(); _mainMenuController?.Dispose(); _fightWindowController?.Dispose(); break; case GameState.DailyReward: _dailyRewardController = new DailyRewardController(_placeForUi, _dailyRewardView, _currencyView); _dailyRewardController.RefreshView(); break; case GameState.Fight: _fightWindowController = new FightWindowController(_placeForUi, _fightWindowView, _profilePlayer); _fightWindowController.RefreshView(); _mainMenuController?.Dispose(); _startFightController?.Dispose(); _gameController?.Dispose(); break; default: DisposeAllControllers(); break; } }
private void LootNpcBtn(object sender, EventArgs e) { FightWindowController.LootNpcBtn(); }
//**ИНТЕРАКТИВНЫЕ ЭЛЕМЕНТЫ ФОРМЫ**// private void AttackBtn(object sender, EventArgs e) { FightWindowController.AttackBtn(); }
private void ClosedForm(object sender, FormClosedEventArgs e) // Закрытие формы { FightWindowController.ClosedForm(); }
private void BackBtn(object sender, EventArgs e) // Кнопка "Назад" { FightWindowController.BackBtn(); }
public void RShowWindow() // Метод показа этой формы { FightWindowController.RShowWindow(); }
//**// //**ОСНОВЫЕ МЕТОДЫ**// public void ShowWindow(INPC NPC) // Метод показа этой формы { FightWindowController.ShowWindow(NPC); }
//**БЛОК ОБНОВЛЕНИЯ ФОРМЫ**// //В данном случае не используется, т.к. форма открывается через ShowWindow, вызывающий инициализацию// private void InitializeForm(object sender, EventArgs e) { FightWindowController.InitializeForm(); }