Пример #1
0
    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;
        }
    }
Пример #2
0
    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;
        }
    }
Пример #3
0
 private void LootNpcBtn(object sender, EventArgs e)
 {
     FightWindowController.LootNpcBtn();
 }
Пример #4
0
        //**ИНТЕРАКТИВНЫЕ ЭЛЕМЕНТЫ ФОРМЫ**//

        private void AttackBtn(object sender, EventArgs e)
        {
            FightWindowController.AttackBtn();
        }
Пример #5
0
 private void ClosedForm(object sender, FormClosedEventArgs e) // Закрытие формы
 {
     FightWindowController.ClosedForm();
 }
Пример #6
0
 private void BackBtn(object sender, EventArgs e) // Кнопка "Назад"
 {
     FightWindowController.BackBtn();
 }
Пример #7
0
 public void RShowWindow() // Метод показа этой формы
 {
     FightWindowController.RShowWindow();
 }
Пример #8
0
        //**//

        //**ОСНОВЫЕ МЕТОДЫ**//

        public void ShowWindow(INPC NPC) // Метод показа этой формы
        {
            FightWindowController.ShowWindow(NPC);
        }
Пример #9
0
 //**БЛОК ОБНОВЛЕНИЯ ФОРМЫ**//
 //В данном случае не используется, т.к. форма открывается через ShowWindow, вызывающий инициализацию//
 private void InitializeForm(object sender, EventArgs e)
 {
     FightWindowController.InitializeForm();
 }