示例#1
0
    public List <CardStruct> GetCards(uint numb)
    {
        List <CardStruct> getCardList = new List <CardStruct>();

        for (int i = 0; i < numb; i++)
        {
            CardStruct card = OpenCardList[OpenCardList.Count - 1];
            OpenCardList.Remove(card);
            CloseCardList.Add(card);
            getCardList.Add(card);
        }
        Rpc_UpdateCardNumbers();
        return(getCardList);
    }
示例#2
0
    public CardStruct GetCard(bool isWild = false)
    {
        int randIndex = UnityEngine.Random.Range(0, OpenCardList.Count - 1);

        CardStruct card = OpenCardList[randIndex];

        if (isWild)
        {
            if ((ENUM_CARD_TYPE)card.CardType == ENUM_CARD_TYPE.WILD_DRAW4 || (ENUM_CARD_TYPE)card.CardType == ENUM_CARD_TYPE.WILD)
            {
                return(GetCard(isWild));
            }
        }

        OpenCardList.Remove(card);
        CloseCardList.Add(card);

        Rpc_UpdateCardNumbers();
        return(card);
    }