예제 #1
0
        public static bool ComparePoker(List <int> applycard, List <int> cardlist)
        {
            PokerThreeGroupType _applytype = GetThreeCardType(applycard);
            PokerThreeGroupType _type      = GetThreeCardType(cardlist);

            return(ComparePoker(applycard, _applytype, cardlist, _type));
        }
예제 #2
0
        /// <summary>
        /// applycard 表示申请比牌的人
        /// </summary>
        /// <param name="applycard"></param>
        /// <param name="_applytype"></param>
        /// <param name="cardlist"></param>
        /// <param name="_type"></param>
        /// <returns></returns>
        private static bool ComparePoker(List <int> applycard, PokerThreeGroupType _applytype, List <int> cardlist, PokerThreeGroupType _type)
        {
            if (_applytype > _type)
            {
                return(true);
            }
            else if (_applytype < _type)
            {
                return(false);
            }
            else
            {//相同类型 需要根据规则再处理一次,
                List <int> _tapplyList = QuSeOrder(applycard);

                List <int> _tempCardList = QuSeOrder(cardlist);
                switch (_applytype)
                {
                case PokerThreeGroupType.Three:    //
                    if (GetThreeTypeValue(_tapplyList) > GetThreeTypeValue(_tempCardList))
                    {
                        return(true);
                    }
                    return(false);

                case PokerThreeGroupType.TongHuaSun:
                case PokerThreeGroupType.TongHua:
                case PokerThreeGroupType.SunZhi:
                    return(GetApplyWin(_tapplyList, _tempCardList));

                case PokerThreeGroupType.SunZhi123:
                    return(false);

                case PokerThreeGroupType.Double:
                    if (GetDoubleValue(_tapplyList) > GetDoubleValue(_tempCardList))
                    {
                        return(true);
                    }
                    else if (GetDoubleValue(_tapplyList) < GetDoubleValue(_tempCardList))
                    {
                        return(false);
                    }
                    else
                    {
                        if (_tapplyList[0] == _tapplyList[1])
                        {
                            if (_tapplyList[2] > _tempCardList[2])
                            {
                                return(true);
                            }
                            else
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (_tapplyList[0] > _tempCardList[0])
                            {
                                return(true);
                            }
                            else
                            {
                                return(false);
                            }
                        }
                    }

                case PokerThreeGroupType.Single:
                    return(GetApplyWin(_tapplyList, _tempCardList));
                }
            }
            return(false);
        }