Esempio n. 1
0
    void moveDown(GameEntity e, Vector2Int position)
    {
        var nextRowPos = BoardLogic.GetNextEmptyRow(_contexts, position);

        if (nextRowPos != position.y)
        {
            e.ReplacePosition(new Vector2Int(position.x, nextRowPos));
        }
    }
Esempio n. 2
0
    void moveDown(GameEntityG e, Vector2Int position)
    {
        var nextRowPos = BoardLogic.GetNextEmptyRow(Scope, position);

        if (nextRowPos != position.y)
        {
            e.Replace(G.Cache <PositionG> .I.Set(new Vector2Int(position.x, nextRowPos)));
        }
    }
    private void MoveDown(GameEntity entity, Vector2 position)
    {
        var nextRowPos = BoardLogic.GetNextEmptyRow(_contexts.game, position);

        if (nextRowPos != position.y)
        {
            entity.ReplacePosition(new Vector2(position.x, nextRowPos));
        }
    }
Esempio n. 4
0
    protected override void Execute(List <GameEntity> entities)
    {
        var board = _contexts.game.board.value;

        for (int x = 0; x < board.x; x++)
        {
            var position   = new Vector2Int(x, board.y);
            var nextRowPos = BoardLogic.GetNextEmptyRow(_contexts, position);
            while (nextRowPos != board.y)
            {
                _contexts.game.CreateRandomPiece(x, nextRowPos, 0);
                nextRowPos = BoardLogic.GetNextEmptyRow(_contexts, position);
            }
        }
    }
    protected override void Execute(List <GameEntityG> entities)
    {
        var board = GameStateScope.Get <BoardG>().value;

        for (int x = 0; x < board.x; x++)
        {
            var position   = new Vector2Int(x, board.y);
            var nextRowPos = BoardLogic.GetNextEmptyRow(GameScope, position);
            while (nextRowPos != board.y)
            {
                GameScope.CreateRandomPiece(x, nextRowPos);
                nextRowPos = BoardLogic.GetNextEmptyRow(GameScope, position);
            }
        }
    }
Esempio n. 6
0
    protected override void Execute(List <GameEntity> entities)
    {
        var board = _contexts.game.gameBoard;

        for (int column = 0; column < board.columns; column++)
        {
            var position        = new Vector2(column, board.rows);
            var nextRowPosition = BoardLogic.GetNextEmptyRow(_contexts.game, position);
            while (nextRowPosition != board.rows)
            {
                _contexts.game.CreateRandomPiece(column, nextRowPosition);
                nextRowPosition = BoardLogic.GetNextEmptyRow(_contexts.game, position);
            }
        }
    }