protected override void Execute(List <InputEntity> entities)
    {
        var inputEntity = entities.SingleEntity();
        var input       = inputEntity.input;

        var position             = new Vector2(input.x, input.y);
        var entitiesWithPosition = BoardLogic.GetEntitiesWithPosition(_contexts.game, position);

        foreach (var entity in entitiesWithPosition)
        {
            if (entity != null && entity.isInteractive)
            {
                entity.isDestroyed = true;
            }
        }
        inputEntity.Destroy();
    }
Ejemplo n.º 2
0
    protected override void Execute(List <GameEntity> entities)
    {
        var board = _contexts.game.gameBoard;

        for (int column = 0; column < board.columns; column++)
        {
            for (int row = 1; row < board.rows; row++)
            {
                var position             = new Vector2(column, row);
                var entitiesWithPosition = BoardLogic.GetEntitiesWithPosition(_contexts.game, position);
                foreach (var entity in entitiesWithPosition)
                {
                    if (entity != null && entity.isMovable)
                    {
                        MoveDown(entity, position);
                    }
                }
            }
        }
    }