Ejemplo n.º 1
0
    private HuStruct AddHuCard(ref List <HuStruct> mycard, MJoptInfoData data, int lastoutcard)
    {
        //我牌里面加一组
        if (mycard == null)
        {
            mycard = new List <HuStruct>();
        }
        HuStruct chicard = new HuStruct();

        if (mHandCard != null && mHandCard.currCard > 0)//摸起来的牌加到手牌中并且去掉摸起来的牌
        {
            mHandCard.cards.Add(mHandCard.currCard);
            mHandCard.currCard = 0;
        }
        else if (mOtherCard != null && mOtherCard.isHasCurrCard)
        {
            mOtherCard.cardsNum     += 1;
            mOtherCard.isHasCurrCard = false;
        }
        if (data.ins == eMJInstructionsType.HU)
        {
            if (data.type == (int)eHuType.ZIMO)
            {
                if (mHandCard != null && data.seatId == MJGameModel.Inst.mMySeatId)
                {
                    mHandCard.cards.RemoveAt(mHandCard.cards.Count - 1);
                    mHandCard.currCard = 0;
                }
                else
                {
                    mOtherCard.cardsNum--;
                }
            }
            chicard.card = data.cards[0];
            chicard.isGl = data.huGl;
        }

        if (mHandCard != null)
        {
            mycard.Add(chicard);
        }
        return(chicard);
    }
Ejemplo n.º 2
0
    private HuStruct AddHuCard(ref List <HuStruct> mycard, MJoptInfoData data, int lastoutcard)
    {
        //我牌里面加一组
        if (mycard == null)
        {
            mycard = new List <HuStruct>();
        }
        HuStruct chicard = new HuStruct();

        if (handList != null && currCard > 0)//摸起来的牌加到手牌中并且去掉摸起来的牌
        {
            handList.Add(currCard);
            currCard = 0;
        }
        else if (isHasCurrCard)
        {
            cardNum      += 1;
            isHasCurrCard = false;
        }
        if (data.ins == eMJInstructionsType.HU || data.ins == eMJInstructionsType.YPDX)
        {
            if (data.type == (int)eHuType.ZIMO)
            {
                if (handList != null)
                {
                    handList.RemoveAt(handList.Count - 1);
                    currCard = 0;
                }
                else
                {
                    cardNum--;
                }
            }
            chicard.card   = data.cards[0];
            chicard.isGl   = data.huGl;
            chicard.huType = data.type;
        }

        mycard.Add(chicard);
        return(chicard);
    }