コード例 #1
0
        public MoveHeroSystem(GameContext game, InputContext input)
        {
            _game = game;

            _heroes = game.GetGroup(GameMatcher.AllOf(GameMatcher.Hero));
            _inputs = input.GetGroup(InputMatcher.AllOf(InputMatcher.Horizontal));
        }
コード例 #2
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AllOf(
                                        InputMatcher.Command,
                                        InputMatcher.ToggleLightCommand
                                        )));
 }
コード例 #3
0
ファイル: MouseInput.cs プロジェクト: lyricjin/EntitasGard
 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);
 }
コード例 #4
0
ファイル: GameContextSystem.cs プロジェクト: Sk0ut/Earthborn
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(
                                        InputMatcher.AxisInput,
                                        InputMatcher.KeyInput
                                        )));
 }
コード例 #5
0
 public UserInputProcessor(Contexts contexts)
 {
     _contexts         = contexts;
     _context          = contexts.input;
     _mouseEventsGroup = _context.GetGroup(InputMatcher.AllOf(InputMatcher.MouseEvent, InputMatcher.ScreenPoint));
     _keyEventsGroup   = _context.GetGroup(InputMatcher.AllOf(InputMatcher.KeyEvent));
     _mouseEventEntity = _context.GetGroup(InputMatcher.MouseEvent).GetSingleEntity();
 }
コード例 #6
0
 public DragSelectionSystem(Contexts contexts) : base(contexts.input)
 {
     _contexts = contexts;
     _context  = contexts.input;
     _selectedEntitiesGroup  = contexts.game.GetGroup(GameMatcher.AllOf(GameMatcher.Selected));
     _keyEventGroup          = contexts.input.GetGroup(InputMatcher.AllOf(InputMatcher.KeyEvent, InputMatcher.KeyHeld));
     _dragSelectionDataGroup = contexts.input.GetGroup(InputMatcher.DragSelectionData);
 }
コード例 #7
0
 public RemoveReactiveUIListenersSystem(Contexts contexts) : base(contexts.game)
 {
     this._contexts  = contexts;
     gameEntityGroup = this._contexts.game.GetGroup(GameMatcher.AnyOf(GameMatcher.ElixirListener
                                                                      , GameMatcher.TickListener));
     inputEntityGroup =
         this._contexts.input.GetGroup(InputMatcher.AllOf(InputMatcher.PauseListener));
 }
コード例 #8
0
 public SystemMoveInput(Contexts contexts, IServiceContainer serviceContainer) :
     base(contexts, serviceContainer)
 {
     _inputGroup = contexts.input.GetGroup(InputMatcher.AllOf(
                                               InputMatcher.MoveDir,
                                               InputMatcher.ActorId,
                                               InputMatcher.Tick));
 }
コード例 #9
0
ファイル: MovePlayer.cs プロジェクト: stepanovalexei/maze
        public MovePlayer(GameContext game, InputContext input)
        {
            this.game = game;

            players     = game.GetGroup(GameMatcher.AllOf(GameMatcher.Player));
            verticals   = input.GetGroup(InputMatcher.AllOf(InputMatcher.Vertical));
            horizontals = input.GetGroup(InputMatcher.AllOf(InputMatcher.Horizontal));
        }
コード例 #10
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(
                InputMatcher.AllOf(
                    InputMatcher.ScreenPoint,
                    InputMatcher.MouseEvent
                    ).AnyOf(InputMatcher.LeftMouseButtonDown, InputMatcher.LeftMouseButtonHeld, InputMatcher.LeftMouseButtonUp)
                ));
 }
コード例 #11
0
 public override BaseSystem DoInit(Contexts contexts, IServiceContainer serviceContainer)
 {
     base.DoInit(contexts, serviceContainer);
     _inputGroup = contexts.input.GetGroup(InputMatcher.AllOf(
                                               InputMatcher.InputInfo,
                                               InputMatcher.ActorId,
                                               InputMatcher.Tick));
     return(this);
 }
コード例 #12
0
ファイル: EmitMiningTaskSystem.cs プロジェクト: nie341/erebus
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(
                InputMatcher.AllOf(
                    InputMatcher.MouseUp,
                    InputMatcher.LeftMouse
                    )
                ));
 }
コード例 #13
0
ファイル: BuildCommands.cs プロジェクト: lyricjin/EntitasGard
        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));
        }
コード例 #14
0
        public ExecuteNavigationInput(Contexts contexts, ServiceContainer serviceContainer)
        {
            _gameContext      = contexts.game;
            _gameStateContext = contexts.gameState;

            _navigationInput = contexts.input.GetGroup(InputMatcher.AllOf(
                                                           InputMatcher.Coordinate,
                                                           InputMatcher.Selection,
                                                           InputMatcher.ActorId,
                                                           InputMatcher.Tick));
        }
コード例 #15
0
        public ExecuteNavigationInput(Contexts contexts, Services services)
        {
            _services          = services;
            _navigationService = services.Get <INavigationService>();
            _gameContext       = contexts.game;
            _gameStateContext  = contexts.gameState;

            _navigationInput = contexts.input.GetGroup(InputMatcher.AllOf(
                                                           InputMatcher.Coordinate,
                                                           InputMatcher.Selection,
                                                           InputMatcher.ActorId,
                                                           InputMatcher.Tick));
        }
コード例 #16
0
        public ExecuteSpawnInput(Contexts contexts, ServiceContainer serviceContainer)
        {
            _viewService      = serviceContainer.Get <IViewService>();
            _gameContext      = contexts.game;
            _gameStateContext = contexts.gameState;
            _actorContext     = contexts.actor;

            _spawnInputs = contexts.input.GetGroup(
                InputMatcher.AllOf(
                    InputMatcher.EntityConfigId,
                    InputMatcher.ActorId,
                    InputMatcher.Coordinate,
                    InputMatcher.Tick));
        }
コード例 #17
0
 public void Execute()
 {
     foreach (var input in _inputContext.GetEntities(
                  InputMatcher.AllOf(
                      InputMatcher.Tick,
                      InputMatcher.Coordinate,
                      InputMatcher.Selection,
                      InputMatcher.ActorId))
              .Where(entity => entity.tick.value < _gameStateContext.tick.value))
     {
         var ents = _gameContext.GetEntities(GameMatcher.LocalId)
                    .Where(entity => entity.actorId.value == input.actorId.value).Select(entity => entity.id.value);
         var missing = input.selection.entityIds.Where(u => !ents.Contains(u)).ToList();
         if (missing.Any())
         {
             _services.Get <ILogService>().Warn(missing.Count + " missing for actor: " + input.actorId.value);
         }
     }
 }
コード例 #18
0
        public void Execute()
        {
            foreach (var input in _inputContext.GetEntities(
                         InputMatcher.AllOf(
                             InputMatcher.Tick,
                             InputMatcher.Coordinate,
                             InputMatcher.Selection,
                             InputMatcher.ActorId))
                     .Where(entity => entity.tick.value < _gameStateContext.tick.value))
            {
                var targetActorId = input.hasTargetActorId ? input.targetActorId.value : input.actorId.value;

                var ents = _gameContext.GetEntities(GameMatcher.LocalId)
                           .Where(entity => entity.actorId.value == targetActorId).Select(entity => entity.id.value);
                var missing = input.selection.entityIds.Where(u => !ents.Contains(u)).ToList();
                if (missing.Any())
                {
                    Log.Warn(this, missing.Count + " missing for actor: " + targetActorId + " (command from " + input.actorId.value + ")");
                }
            }
        }
コード例 #19
0
 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
     }
                ));
 }
コード例 #20
0
 protected override void SetTriggers()
 {
     Trigger(InputMatcher.AllOf(InputMatcher.EventId).Added());
 }
コード例 #21
0
 protected override void SetTriggers()
 {
     Trigger(InputMatcher.AllOf(InputMatcher.ChannelSwitchEvent).Added());
 }
コード例 #22
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.ShowUiCommand, InputMatcher.HideUiCommand)));
 }
コード例 #23
0
ファイル: Common.cs プロジェクト: interess/GGJ2018
 protected override void SetTriggers()
 {
     Trigger(Contexts.input.CreateCollector(InputMatcher.AllOf(InputMatcher.FlagTrash, InputMatcher.FlagTrashValidated).Added()));
     Trigger(Contexts.state.CreateCollector(StateMatcher.AllOf(StateMatcher.FlagTrash, StateMatcher.FlagTrashValidated).Added()));
 }
コード例 #24
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     //return collector
     return(context.CreateCollector(InputMatcher.AllOf(InputMatcher.InputTouchData)));
 }
コード例 #25
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AllOf(InputMatcher.ClickDown, InputMatcher.HoldingClick)));
 }
コード例 #26
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AllOf(InputMatcher.TouchType)));
 }
コード例 #27
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     // triggers:
     // PointerOverUi.AddedOrRemoved
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.PointerOverUi.AddedOrRemoved().matcher)));
 }
コード例 #28
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.MouseClickDown, InputMatcher.MouseClickStay)));
 }
コード例 #29
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 => context.CreateCollector(InputMatcher.AllOf(InputMatcher.Input, InputMatcher.MouseUp));
 protected override Collector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AllOf(InputMatcher.RightMouse, InputMatcher.MouseDown)));
 }