Ejemplo n.º 1
0
        private void ChangeWaybill(object sender, EventArgs e)
        {
            IUnitOfWork uow     = Scout.Core.Data.GetUnitOfWork();
            string      waybill = "";

            UserInputView inputView =
                new UserInputView((s) => waybill = s, "Enter waybill", true)
            {
                ShowCancelButton = true
            };


            DialogResult result = inputView.ShowDialog();

            if (result == DialogResult.OK)
            {
                foreach (Packlist p in GetSelectedPacklists(uow))
                {
                    p.Waybill = waybill;
                }

                uow.Commit();

                m_searchForm.RunSearch();
            }
        }
Ejemplo n.º 2
0
 public NavigationModel(MainWindow window, Storage data)
 {
     _window        = window;
     _UserInputView = new UserInputView(data);
     _userInfoView  = new UserInfoView(data);
     _usersView     = new UsersView(data);
 }
Ejemplo n.º 3
0
    void InitializeGame()
    {
        //инициализируем пулл объектов
        Instantiate(ObjectPoolSetup);

        //инициализируем звездное небо
        Instantiate(StarsGenerator);
        //инициализируем игрока
        _player = Instantiate(PlayerPrefab) as GameObject;
        _playerMovementModel = new PlayerMovementModel(_player, RotationSpeed, MovingSpeed);

        //инициализируем стрельбу и урон
        _shotModel        = new ShootModel(_player);
        _damageController = new DamageController();
        Instantiate(StrongWeaponController);

        //инициализируем пользовательский ввод
        _inputController = new UserInputController(_playerMovementModel, _shotModel);
        _userInput       = _inputController.GetUserInputView();

        //инициализируем UI
        _playerPannel = new PlayerPannelController(PlayerPannel);
        _uiController = new UIController();
        _gameEventSystem.UpdateStrongBulletValueLaunch(MaxSrongBulletsCount);
        _scoreController = new ScoreController(ScoreDisplay);

        //инициализируем спавн астероидов
        Instantiate(AwaitingControllerPrefab);
        _spawnModel = new ObjectSpawnModel(AsteroidsSpawnPointsObject);
        _asteroidsSpawnController = new AsteroidsSpawnController(_spawnModel);
        _ufoSpawnController       = new UFOSpawnController(_spawnModel);

        _isGameInitialized = true;
    }
Ejemplo n.º 4
0
        private void ChangeScrapControlNumber(object sender, EventArgs e)
        {
            IUnitOfWork uow = Scout.Core.Data.GetUnitOfWork();
            string      scrapControlNumber = "";

            UserInputView inputView =
                new UserInputView((s) => scrapControlNumber = s, "Enter Scrap Control Number", true)
            {
                ShowCancelButton = true
            };


            DialogResult result = inputView.ShowDialog();

            if (result == DialogResult.OK)
            {
                foreach (Packlist p in GetSelectedPacklists(uow))
                {
                    p.XipControlNumber = scrapControlNumber;
                }

                uow.Commit();

                m_searchForm.RunSearch();
            }
        }
Ejemplo n.º 5
0
        public override void Execute()
        {
            UserInputView view =
                new UserInputView(InputCallBack, m_inputMessage, m_required);

            view.StartPosition = FormStartPosition.CenterParent;
            view.ShowDialog();
        }
Ejemplo n.º 6
0
        public string Read()
        {
            string text = string.Empty;

            UserInputView userInputView = new UserInputView();

            userInputView.ShowDialog();

            if (userInputView.DialogResult == true)
            {
                return(userInputView.UserInputTexts);
            }

            return(text);
        }
Ejemplo n.º 7
0
        private void enterWaybillButton_Click(object sender, EventArgs e)
        {
            if (Session.CurrentPacklist == null)
            {
                return;
            }

            UserInputView inputView
                = new UserInputView(s => Session.CurrentPacklist.Waybill = s, "Enter waybill", false);

            inputView.ShowDialog(this);

            Session_PacklistChanged(Session.CurrentPacklist);

            Scout.Core.Data.Save(Session.UnitOfWork);
        }
Ejemplo n.º 8
0
    public UserInputController(PlayerMovementModel movementModel, ShootModel shotModel)
    {
        _playerMovModel = movementModel;
        _shootModel     = shotModel;
        _userInputView  = new UserInputView(this);
        GameManager.Instanse.GameEventSystem.StartGame  += OnStartGame;
        GameManager.Instanse.GameEventSystem.KeyPress   += OnKeyPressed;
        GameManager.Instanse.GameEventSystem.KeyUp      += OnKeyUp;
        GameManager.Instanse.GameEventSystem.FinishGame += OnFinishGame;

        //инициализируем команды
        _commandsDictionary.Add(KeyCode.UpArrow, new MoveTowardsCommand(_playerMovModel));
        _commandsDictionary.Add(KeyCode.LeftArrow, new RotateLeftCommand(_playerMovModel));
        _commandsDictionary.Add(KeyCode.RightArrow, new RotateRightCommand(_playerMovModel));
        _commandsDictionary.Add(KeyCode.Space, new FireWithWeakWeaponCommand(_shootModel));
        _commandsDictionary.Add(KeyCode.LeftShift, new FireWithStrongBulletCommand());
        _commandsDictionary.Add(KeyCode.LeftControl, new FireWithStrongLaserCommand());
        _commandsDictionary.Add(KeyCode.Escape, new GamePauseCommand());
    }
Ejemplo n.º 9
0
 // Public functions
 public void Init()
 {
     input = GetComponentInChildren <UserInputView>();
 }