예제 #1
0
파일: Judgment.cs 프로젝트: w1233120/Big-2
    // 檢查非怪物牌比較
    private static bool CheckNomalCard(List <Card> cards, List <Card> LastCards, CardsType cardType)
    {
        if (CheckCardType(cards) > CardsType.FullHouse) // 如果自身牌為怪物牌直接給過
        {
            return(true);
        }

        switch (cardType)   // 不是的話另外判斷
        {
        case CardsType.Single:
            if (CardTypeCheckMgr.IsSingle(cards) == CardsType.Single)
            {
                return(CardTypeCheckMgr.compSingle(cards[0], LastCards[0]));
            }
            return(false);

        case CardsType.Pair:
            if (CardTypeCheckMgr.IsPair(cards) == CardsType.Pair)
            {
                return(CardTypeCheckMgr.compPair(cards[cards.Count - 1], LastCards[LastCards.Count - 1]));
            }
            return(false);

        case CardsType.ThreeOfKinds:
            if (CardTypeCheckMgr.IsThreeOfKinds(cards) == CardsType.ThreeOfKinds)
            {
                return(CardTypeCheckMgr.compThreeOfKinds(cards[cards.Count - 1], LastCards[LastCards.Count - 1]));
            }
            return(false);

        case CardsType.Straight:
            if (CardTypeCheckMgr.IsStraight(cards) == CardsType.Straight)
            {
                return(CardTypeCheckMgr.compStraight(cards, LastCards));
            }
            return(false);

        case CardsType.FullHouse:
            if (CardTypeCheckMgr.IsFullHouse(cards) == CardsType.FullHouse)
            {
                return(CardTypeCheckMgr.compFullHouse(cards, LastCards));
            }
            return(false);
        }
        return(false);
    }
예제 #2
0
파일: Judgment.cs 프로젝트: w1233120/Big-2
    /// <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);
        }
    }