// 皇家同花顺(A,K,Q,J,10) BOOL CUpGradeGameLogic::IsRegiusContinue(BYTE iCardList[],int iCardCount) { if(iCardCount < 4) return FALSE; if (!IsSameHua(iCardList, iCardCount)) return FALSE; if (!IsSingleContinue(iCardList, iCardCount)) return FALSE; if (!IsSameHuaContinue(iCardList, iCardCount)) return FALSE; BYTE Temp[61] = {0}; for(int i = 0; i < iCardCount; i ++) { Temp[iCardList[i]] ++; } if(Temp[9] && Temp[10] && Temp[11]&& Temp[12] && Temp[13]) return TRUE; if(Temp[25] && Temp[26] && Temp[27]&& Temp[28] && Temp[29]) return TRUE; if(Temp[41] && Temp[42] && Temp[43]&& Temp[44] && Temp[45]) return TRUE; if(Temp[57] && Temp[58] && Temp[59]&& Temp[60] && Temp[61]) return TRUE; return FALSE; }
//获取牌型 BYTE CUpGradeGameLogic::GetCardShape(BYTE iCardList[], int iCardCount) { /*************************************************** 同花顺>铁支>葫芦>同花>顺子>三条>两对>对子>散牌 ***************************************************/ if (iCardCount <= 0) return UG_ERROR_KIND;//非法牌 if (IsSameHuaContinue(iCardList,iCardCount)) return SH_SAME_HUA_CONTINUE;//同花顺 if (IsSmallSameHuaContinue(iCardList,iCardCount)&&(m_dwCardShape&(0x00000001<<1))) return SH_SMALL_SAME_HUA_CONTINUE;//同花最小顺子 if (IsTieZhi(iCardList,iCardCount)) return SH_TIE_ZHI;//铁支 if (IsHuLu(iCardList,iCardCount)) return SH_HU_LU;//葫芦 if (IsSameHua(iCardList,iCardCount)) return SH_SAME_HUA;//同花 if (IsSingleContinue(iCardList,iCardCount)) return SH_CONTINUE;//顺子 if (IsSmallSingleContinue(iCardList,iCardCount)&&(m_dwCardShape&(0x00000001<<1))) return SH_SMALL_CONTINUE; //最小顺子 if (IsThree(iCardList,iCardCount)) return SH_THREE;//三条 if (IsCompleDouble(iCardList,iCardCount)) return SH_TWO_DOUBLE;//两对 if (IsDouble(iCardList,iCardCount)) return SH_DOUBLE;//对子 return SH_OTHER;//散牌 }