Exemplo n.º 1
0
    // 檢查怪物牌比較
    private static bool CheckMonsterCard(List <Card> cards, List <Card> LastCard, CardsType cardType)
    {
        // 先看看自己手上有沒有怪物牌
        // 如果我的怪物牌比場上怪物牌還大直接給過, 相同則需比較
        if (CheckCardType(cards) > cardType)
        {
            return(true);
        }
        else
        {
            switch (cardType)
            {
            case CardsType.FourOfKinds:
                if (CardTypeCheckMgr.IsFourOfKinds(cards) == CardsType.FourOfKinds)
                {
                    return(CardTypeCheckMgr.compFourOfKinds(cards, LastCard));
                }
                return(false);

            case CardsType.StraightFlush:
                if (CardTypeCheckMgr.IsStraightFlush(cards) == CardsType.StraightFlush)
                {
                    return(CardTypeCheckMgr.compStraightFlush(cards, LastCard));
                }
                return(false);
            }
        }
        return(false);
    }
Exemplo n.º 2
0
    /// <summary> 確認牌型 </summary>
    public static CardsType CheckCardType(List <Card> cards)
    {
        //foreach (var card in cards)
        //{
        //    Debug.Log(card.value);
        //}

        if (CardTypeCheckMgr.IsSingle(cards) == CardsType.Single)
        {
            return(CardsType.Single);
        }
        else if (CardTypeCheckMgr.IsPair(cards) == CardsType.Pair)
        {
            return(CardsType.Pair);
        }
        else if (CardTypeCheckMgr.IsThreeOfKinds(cards) == CardsType.ThreeOfKinds)
        {
            return(CardsType.ThreeOfKinds);
        }
        else if (CardTypeCheckMgr.IsStraight(cards) == CardsType.Straight)
        {
            return(CardsType.Straight);
        }
        else if (CardTypeCheckMgr.IsFullHouse(cards) == CardsType.FullHouse)
        {
            return(CardsType.FullHouse);
        }
        else if (CardTypeCheckMgr.IsFourOfKinds(cards) == CardsType.FourOfKinds)
        {
            return(CardsType.FourOfKinds);
        }
        else if (CardTypeCheckMgr.IsStraightFlush(cards) == CardsType.StraightFlush)
        {
            return(CardsType.StraightFlush);
        }
        else
        {
            return(CardsType.None);
        }
    }