protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 => context.CreateCollector(GameMatcher.AnyOf(
                                GameMatcher.ItemType,
                                GameMatcher.CellItemType,
                                GameMatcher.ComboType,
                                GameMatcher.ActiveRotor)
                            );
Beispiel #2
0
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(
                GameMatcher.AnyOf(GameMatcher.Aggressive, GameMatcher.Sleeping)
                .AddedOrRemoved()
                ));
 }
 public CellStateDeterminationSystem(Contexts contexts) : base(contexts.game)
 {
     _contexts      = contexts;
     _cellGroup     = contexts.game.GetGroup(GameMatcher.Cell);
     _itemGroup     = contexts.game.GetGroup(GameMatcher.AnyOf(GameMatcher.Item, GameMatcher.FakeItem));
     _cellItemGroup = contexts.game.GetGroup(GameMatcher.CellItem);
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(
                GameMatcher.AnyOf(
                    GameMatcher.Planet,
                    GameMatcher.Rocket)));
 }
 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));
 }
Beispiel #6
0
    public RunningSystem(Contexts contexts)
    {
        _contexts = contexts;

        _entites = contexts.game.GetGroup(
            GameMatcher.AnyOf(GameMatcher.StateRunningToEnemy, GameMatcher.StateRunningFromEnemy)
            );
    }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(
                                        GameMatcher.WillSpawnItem,
                                        GameMatcher.WillSpawnCellItem,
                                        GameMatcher.WillBeDestroyed,
                                        GameMatcher.Falling,
                                        GameMatcher.GridPosition)));
 }
 public StartNewGameSystem(Contexts contexts)
 {
     gameContext        = contexts.game;
     inputContext       = contexts.input;
     newGameButtonGroup = gameContext.GetGroup(GameMatcher.AllOf(GameMatcher.NewGameButton, GameMatcher.View));
     buttonGroup        = gameContext.GetGroup(GameMatcher.NewGameButton);
     scoreGroup         = gameContext.GetGroup(GameMatcher.AnyOf(GameMatcher.Player1Score, GameMatcher.Player2Score));
     uiGroup            = gameContext.GetGroup(GameMatcher.UiElement);
     disableInputGroup  = inputContext.GetGroup(InputMatcher.DisableInput);
 }
Beispiel #9
0
    public void Execute()
    {
        var entities = _contexts.game.GetGroup(GameMatcher.AnyOf(GameMatcher.Velocity, GameMatcher.Chunk, GameMatcher.RigidBody2D)).GetEntities();


        foreach (var entity in entities)
        {
            entity.rigidBody2D.value.Velocity = entity.velocity.value;
        }
    }
Beispiel #10
0
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(new Collector <GameEntity>(
                new [] {
         context.GetGroup(GameMatcher.AnyOf(GameMatcher.Position, GameMatcher.Rotation)),
         context.GetGroup(GameMatcher.View),
     }, new [] {
         GroupEvent.Added,
         GroupEvent.Added,
     }
                ));
 }
Beispiel #11
0
 public CheckDieSystem(GameContext Game) : base(Game)
 {
     gameContext = Game;
     heartGroup  = gameContext.GetGroup(GameMatcher.AllOf(GameMatcher.Heart, GameMatcher.Position));
     blockGroup  = gameContext.GetGroup(GameMatcher.AllOf(GameMatcher.Position,
                                                          GameMatcher.BoadGameElement).NoneOf(GameMatcher.Heart, GameMatcher.MoveNum));
     blockSuffle = gameContext.GetGroup(GameMatcher.AllOf(GameMatcher.Position,
                                                          GameMatcher.BoadGameElement, GameMatcher.Downable).NoneOf(GameMatcher.Heart, GameMatcher.MoveNum));
     viewGroup      = gameContext.GetGroup(GameMatcher.View);
     mechanicsGroup =
         gameContext.GetGroup(GameMatcher.AnyOf(GameMatcher.Boom, GameMatcher.Rocket, GameMatcher.Disco));
 }
Beispiel #12
0
        public void Execute()
        {
            var entities = _contexts.game.GetEntities(GameMatcher.AnyOf(GameMatcher.SelectionDown,
                                                                        GameMatcher.SelectionOut, GameMatcher.SelectionOver, GameMatcher.SelectionOut));

            foreach (var gameEntity in entities)
            {
                var entityIndex = gameEntity.id.value;
                var entity      = gameEntity;

                AddOrReplace(entity, 1.0f, 1.0f, 1.0f, 1.0f);

                if (_contexts.meta.selectionService.selection.IsHoverOver(entityIndex))
                {
                    AddOrReplace(entity, 1.0f, 0.0f, 1.0f, 1.0f);
                }

                if (_contexts.meta.selectionService.selection.IsHoverSelect(entityIndex))
                {
                    AddOrReplace(entity, 1f, 1f, 0, 1.0f);
                }


                if (_contexts.meta.selectionService.selection.IsSelectionDown(entityIndex))
                {
                    AddOrReplace(entity, 1, 0, 0, 1.0f); // red
                }

                if (_contexts.meta.selectionService.selection.IsSelectionHeld(entityIndex))
                {
                    AddOrReplace(entity, 0, 0, 1, 1.0f); //blue
                }

                if (_contexts.meta.selectionService.selection.IsSelectionUp(entityIndex))
                {
                    AddOrReplace(entity, 0.5f, 0.5f, 0, 1.0f); // yellow
                }

                if (_contexts.meta.selectionService.selection.IsHoverOut(entityIndex))
                {
                    AddOrReplace(entity, 1f, 1f, 1f, 1.0f); //white
                }

                {
                }
            }
        }
    public void Restart()
    {
        IGroup <GameEntity> group = Contexts.sharedInstance.game.GetGroup(GameMatcher.AnyOf(GameMatcher.Bullet, GameMatcher.Enemy));

        foreach (var entity in group)
        {
            entity.isDestroy = true;
        }

        group = Contexts.sharedInstance.game.GetGroup(GameMatcher.TileTower);

        foreach (var entity in group)
        {
            entity.tileTower.Tower.isDestroy = true;
            entity.tileTower.Tower           = null;
        }

        MoneyModel.Money         = 40;
        PlayerHealthModel.Health = 20;
    }
Beispiel #14
0
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(
                new TriggerOnEvent <GameEntity>(GameMatcher.AnyOf(GameMatcher.Collected, GameMatcher.Level),
                                                GroupEvent.Added)));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.NavigationReached, GameMatcher.NavigationRecede)));
 }
Beispiel #16
0
 public ShowParentLinesSystem(Contexts contexts)
 {
     _entitiesLines = contexts.game.GetGroup(GameMatcher.AnyOf(GameMatcher.LineRenderer, GameMatcher.ChildrenParentTransform));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.Direction, GameMatcher.InitialDirectionSaver).NoneOf(GameMatcher.DirectionTargeting, GameMatcher.DirectionSaver)));
 }
Beispiel #18
0
        protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
        {
            var matcher = GameMatcher.AnyOf(GameMatcher.Shield, GameMatcher.Parent);

            return(context.CreateCollector(matcher));
        }
Beispiel #19
0
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.OnTriggerEnter, GameMatcher.OnTriggerExit)));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.Player1Winner, GameMatcher.Player2Winner)));
 }
 public InitializeScoreSystem(Contexts contexts)
 {
     gameContext = contexts.game;
     wallGroup   = contexts.game.GetGroup(GameMatcher.AnyOf(GameMatcher.ScoreLeft, GameMatcher.ScoreRight));
 }
Beispiel #22
0
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.TapOnDisco)));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.Sprite, GameMatcher.Position).NoneOf(GameMatcher.Shadow)));
 }
Beispiel #24
0
 public static IAnyOfMatcher <GameEntity> Matcher()
 {
     return(GameMatcher.AnyOf(GameMatcher.Aware, GameMatcher.Sleeping));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.AddedBall, GameMatcher.RemovedBall)));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.TotalKittyAmount, GameMatcher.SavedKittyAmount)
                                    .Added()));
 }
 public RenderPosition(Contexts contexts)
 {
     _group = contexts.game.GetGroup(GameMatcher.AnyOf(GameMatcher.Player1, GameMatcher.Player2));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.LoadLevelTrigger, GameMatcher.LoadNextLevelTrigger)));
 }
Beispiel #29
0
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.Position, GameMatcher.Direction)));
 }
 protected override ICollector <GameEntity> GetTrigger(IContext <GameEntity> context)
 {
     return(context.CreateCollector(GameMatcher.AnyOf(GameMatcher.EventTrigger, GameMatcher.PlayerAdvanceNextDayInput)));
 }