コード例 #1
0
        public UIController(InputModel inputModel, PointModel pointModel,
                            EnemyPool enemyPool, PauseModel pauseModel)
        {
            _controllers = new ControllerList();

            _pause = inputModel.Pause();
            _pause.OnKeyPressed += OnPauseKeyPressed;

            _pointModel = pointModel;
            _pointModel.OnPointsChanged += OnPointsChanged;

            _enemyPool = enemyPool;
            _enemyPool.OnEnemyKilledAndReturned += OnEnemyKilled;

            _lastEnemyKilledPanelController = new LastEnemyKilledPanelController();
            _scorePanelController           = new ScorePanelController();
            _pausePanelController           = new PausePanelController(pauseModel);
            _nullPanelController            = new NullPanelController();

            _controllers.Add(_pausePanelController);

            _scorePanelController.SetText("0");
            _pausePanelController.Close();
            _pausePanelController.OnResumeButtonPressed += ChangePanelController;

            _currentPanelController = _nullPanelController;

            _controllers.Initialize();
        }
コード例 #2
0
ファイル: InputModel.cs プロジェクト: OlekLolKek/Asteroids
 public InputModel()
 {
     _pcInputHorizontal  = new PCInputAxis(AxisNames.HORIZONTAL);
     _pcInputVertical    = new PCInputAxis(AxisNames.VERTICAL);
     _pcInputMouseX      = new PCInputAxis(AxisNames.MOUSE_X);
     _pcInputMouseY      = new PCInputAxis(AxisNames.MOUSE_Y);
     _pcInputPause       = new PCInputKey(AxisNames.PAUSE);
     _pcInputActiveSkill = new PCInputKey(AxisNames.ABILITY);
 }