Пример #1
0
 public MouseInput(Contexts contexts)
 {
     _input       = contexts.input;
     _leftClicks  = _input.GetGroup(InputMatcher.AnyOf(InputMatcher.MouseLeftDown, InputMatcher.MouseLeftReleased));
     _rightClicks = _input.GetGroup(InputMatcher.AnyOf(InputMatcher.MouseRightDown, InputMatcher.MouseRightReleased));
     _mouseHover  = _input.GetGroup(InputMatcher.MouseHover);
 }
Пример #2
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(
                                        InputMatcher.AxisInput,
                                        InputMatcher.KeyInput
                                        )));
 }
Пример #3
0
        public BuildCommands(Contexts contexts) : base(contexts.input)
        {
            _game    = contexts.game;
            _grid    = UnityEngine.GameObject.FindObjectOfType <HexGridBehaviour>();
            _presets = new Presets(_game, _grid);

            _UICommands = contexts.input.GetGroup(InputMatcher.AnyOf(InputMatcher.UIBuildBarracks, InputMatcher.UIBuildTower));
            _selectedBarracksBuilders = _game.GetGroup(GameMatcher.AllOf(GameMatcher.Selected, GameMatcher.CanBuildBarracks));
            _selectedTowerBuilders    = _game.GetGroup(GameMatcher.AllOf(GameMatcher.Selected, GameMatcher.CanBuildBarracks));
        }
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(new Collector <InputEntity>(
                new[]
     {
         context.GetGroup(InputMatcher
                          .AllOf(
                              InputMatcher.KeyEvent,
                              InputMatcher.KeyHeld
                              )
                          ),
         context.GetGroup(InputMatcher.AnyOf(
                              InputMatcher.MouseScrollDown,
                              InputMatcher.MouseScrollUp
                              ))
     },
                new[]
     {
         GroupEvent.AddedOrRemoved,
         GroupEvent.AddedOrRemoved
     }
                ));
 }
Пример #5
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     // triggers:
     // PointerOverUi.AddedOrRemoved
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.PointerOverUi.AddedOrRemoved().matcher)));
 }
Пример #6
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.MouseClickDown, InputMatcher.MouseClickStay)));
 }
Пример #7
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.ShowUiCommand, InputMatcher.HideUiCommand)));
 }
Пример #8
0
        protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
        {
            var matcher = InputMatcher.AnyOf(InputMatcher.Movement, InputMatcher.Attack, InputMatcher.TryingToUseAbility);

            return(context.CreateCollector(matcher));
        }
Пример #9
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.InputActionStarted,
                                                       InputMatcher.InputActionEnded, InputMatcher.InputActionActive)));
 }
Пример #10
0
 protected override Collector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.NextStepEvent,
                                                       InputMatcher.AllAnimationCompleteComponentI)));
 }
Пример #11
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.MouseLeftDown, InputMatcher.MouseLeftReleased)));
 }
Пример #12
0
 public EndGameSystem(Contexts contexts, Systems systems) : base(contexts.input)
 {
     this._contexts = contexts;
     this._systems  = systems;
     group          = this._contexts.input.GetGroup(InputMatcher.AnyOf(InputMatcher.EndGame, InputMatcher.DestroyReactiveUI));
 }
Пример #13
0
 protected override Collector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.NextStepEvent)));
 }
Пример #14
0
 public EmitInputSystem(Contexts contexts)
 {
     _context = contexts.input;
     _inputs  = _context.GetGroup(InputMatcher.AnyOf(InputMatcher.LeftMouse, InputMatcher.MouseDown, InputMatcher.MouseUp, InputMatcher.MousePosition));
 }