//获取扑克类型 BYTE CGameLogic::GetCardKind(BYTE bCardList[], BYTE bCardCount) { if (IsTongHuaShun(bCardList,bCardCount)) return TONG_HUA_SHUN; if (IsTieZhi(bCardList,bCardCount)) return TIE_ZHI; if (IsHuLu(bCardList,bCardCount)) return HU_LU; if (IsTongHua(bCardList,bCardCount)) return TONG_HUA; if (IsShunZhi(bCardList,bCardCount)) return SHUN_ZI; if (IsSanTiao(bCardList,bCardCount)) return SAN_TIAO; if (IsLiangDui(bCardList,bCardCount)) return LAING_DUI; if (IsDuiZhi(bCardList,bCardCount)) return DUI_ZI; return SHAN; }
//获取类型 BYTE CGameLogic::GetCardType(BYTE cbCardData[], BYTE cbCardCount) { //类型判断 if (IsTongHuaShun(cbCardData,cbCardCount)) return CT_TONG_HUA_SHUN; if (IsTieZhi(cbCardData,cbCardCount)) return CT_TIE_ZHI; if (IsHuLu(cbCardData,cbCardCount)) return CT_HU_LU; if (IsTongHua(cbCardData,cbCardCount)) return CT_TONG_HUA; if (IsShunZhi(cbCardData,cbCardCount)) return CT_SHUN_ZI; if (IsSanTiao(cbCardData,cbCardCount)) return CT_THREE_TIAO; if (IsDouble(cbCardData,cbCardCount)) return CT_DOUBLE; if (cbCardCount==1) return CT_SINGLE; return CT_ERROR; }
//获取牌型 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;//散牌 }