Пример #1
0
    public void MergeCards(CardController left, CardController right, List <CardController> cards, List <TileController> commonTiles)
    {
        //Debug.Log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111111!!!!!!!!!!!!!!!!!!!!!!!!!11Column = " + name + " starting MergeCards");
        CardController newLeft = CreateNewCard();

        //Debug.Log("newLeft = " + newLeft.name);
        if (right.GetColumn())
        {
            //Debug.Log(name + " MergeCards: Now to remove " + right.GetColumn());
            right.GetColumn().GetSide().RemoveColumn(right.GetColumn(), true);
            //Debug.Log(name + " Done");
        }

        newLeft.AddChildCard(left);
        newLeft.AddChildCard(right);
        newLeft.SetTiles(commonTiles);

        right.DistributeTiles();
        right.ResizeY();
        left.ResizeX();
        left.ResizeY();
        left.DistributeTiles();

        newLeft.DistributeTiles();
        newLeft.DistributeCards();
        newLeft.ResizeY();
        newLeft.ResizeX();

        SetCard(newLeft);
        //left.GetColumn().GetSide().DistributeColumns();
    }