// int代表一张牌, // 低16位代表牌的数字 1-13 A-K // 高16位代表花色 1-4 黑红梅方 // 1 .无牛 玩家手中无法用3张牌组成10的倍数。 1倍 // 2 .牛丁 玩家牌组一达成后,剩下两张牌相加后个位数为1。 1倍 // 3 .牛二 玩家牌组一达成后,剩下两张牌相加后个位数为2。 2倍 // 4 .牛三 玩家牌组一达成后,剩下两张牌相加后个位数为3。 3倍 // 5 .牛四 玩家牌组一达成后,剩下两张牌相加后个位数为4。 4倍 // 6 .牛五 玩家牌组一达成后,剩下两张牌相加后个位数为5。 5倍 // 7 .牛六 玩家牌组一达成后,剩下两张牌相加后个位数为6。 6倍 // 8 .牛七 玩家牌组一达成后,剩下两张牌相加后个位数为7。 7倍 // 9 .牛八 玩家牌组一达成后,剩下两张牌相加后个位数为8。 8倍 // 10 .牛九 玩家牌组一达成后,剩下两张牌相加后个位数为9。 9倍 // 11 .牛牛 玩家牌组一达成后,剩下两张牌相加后个位数为0。 10倍 // 12 .炸弹 玩家手中有四张牌都是一样的点数。 10倍 // 13 .金牛 玩家手中的五张牌都是J、Q、K的花牌牌型。 10倍 // 14 .五小牛 玩家手中的五张牌都<5,且加起来也≤10的牌型。10倍 enum enumPokerType { CATTLE_NONE = -1, CATTLE_0 = 0, CATTLE_1 = 1, CATTLE_2 = 2, CATTLE_3 = 3, CATTLE_4 = 4, CATTLE_5 = 5, CATTLE_6 = 6, CATTLE_7 = 7, CATTLE_8 = 8, CATTLE_9 = 9, CATTLE_CATTLE = 10, CATTLE_BOMB = 11, CATTLE_GOLD = 12, CATTLE_5SMALL = 13, }; struct stBanker { UINT32 userID; INT32 headID; INT64 bankerGolds; INT64 winGolds; INT32 remainNum; char niceName[64]; }; struct stOneGamePokerInfo { vector<INT32> m_banker; vector<INT32> m_tian; vector<INT32> m_di; vector<INT32> m_xuan; vector<INT32> m_huang; INT32 m_Bets[4]; }; class ALLPokerInfo { public: ALLPokerInfo(); ~ALLPokerInfo(); INT32 GetOnePokerType(INT32 poker); INT32 GetOnePokerPoint(INT32 poker); INT32 GetOnePokerPointBetween1And10(INT32 poker); void ShufflePoker(); void SelectPokerClear(); void SelectPokerLastThreeClear(); void Random2PokerInfo(); void RandomLast3PokerInfo(); void MatchingLast3PokerInfo(INT64 golds, INT64 tian, INT64 di, INT64 xuan, INT64 huang, bool isSystem = true); bool IsInSelectPokerInfo(INT32 pokerInfo); // in is true, not in is false INT32 PlayerCompareBankerPokerInfo(vector<INT32> vecPoker); void ComparePokerInfo(); enumPokerType GetPokerType(vector<INT32> vecPoker); bool GetPokerType5SmallCattle(vector<INT32> vecPoker); bool GetPokerTypeGoldCattle(vector<INT32> vecPoker); bool GetPokerTypeBombCattle(vector<INT32> vecPoker); INT32 GetPokerTypeCattleBetweenZeroAndTen(vector<INT32> vecPoker); stOneGamePokerInfo& GetGamePokerInfo() { return m_allSelectPokerInfo; } private: vector<INT32> m_allModulePoker; stOneGamePokerInfo m_allSelectPokerInfo; };
ALLPokerInfo::ALLPokerInfo() { m_allModulePoker.clear(); m_allSelectPokerInfo.m_banker.clear(); m_allSelectPokerInfo.m_tian.clear(); m_allSelectPokerInfo.m_di.clear(); m_allSelectPokerInfo.m_xuan.clear(); m_allSelectPokerInfo.m_huang.clear(); memset(m_allSelectPokerInfo.m_Bets, 0, sizeof(m_allSelectPokerInfo.m_Bets)); for (int i = 1; i <= 4; ++i) { for (int j = 1; j <= 13; ++j) { INT32 pokerInfo = (i << 16) + j; m_allModulePoker.push_back(pokerInfo); } } } ALLPokerInfo::~ALLPokerInfo() { m_allModulePoker.clear(); m_allSelectPokerInfo.m_banker.clear(); m_allSelectPokerInfo.m_tian.clear(); m_allSelectPokerInfo.m_di.clear(); m_allSelectPokerInfo.m_xuan.clear(); m_allSelectPokerInfo.m_huang.clear(); } INT32 ALLPokerInfo::GetOnePokerType(INT32 poker) { return poker >> 16; } INT32 ALLPokerInfo::GetOnePokerPoint(INT32 poker) { return poker & 0xFFFF; } INT32 ALLPokerInfo::GetOnePokerPointBetween1And10(INT32 poker) { INT32 pokerPoint = GetOnePokerPoint(poker); if (pokerPoint > 10) { pokerPoint = 10; } return pokerPoint; } void ALLPokerInfo::ShufflePoker() { for (INT32 i = m_allModulePoker.size() - 1; i > 0; --i) { swap(m_allModulePoker[rand() % i], m_allModulePoker[i]); } } void ALLPokerInfo::SelectPokerClear() { m_allSelectPokerInfo.m_banker.clear(); m_allSelectPokerInfo.m_tian.clear(); m_allSelectPokerInfo.m_di.clear(); m_allSelectPokerInfo.m_xuan.clear(); m_allSelectPokerInfo.m_huang.clear(); memset(m_allSelectPokerInfo.m_Bets, 0, sizeof(m_allSelectPokerInfo.m_Bets)); } void ALLPokerInfo::SelectPokerLastThreeClear() { while (m_allSelectPokerInfo.m_banker.size() > 2) { m_allSelectPokerInfo.m_banker.pop_back(); } while (m_allSelectPokerInfo.m_tian.size() > 2) { m_allSelectPokerInfo.m_tian.pop_back(); } while (m_allSelectPokerInfo.m_di.size() > 2) { m_allSelectPokerInfo.m_di.pop_back(); } while (m_allSelectPokerInfo.m_xuan.size() > 2) { m_allSelectPokerInfo.m_xuan.pop_back(); } while (m_allSelectPokerInfo.m_huang.size() > 2) { m_allSelectPokerInfo.m_huang.pop_back(); } } void ALLPokerInfo::Random2PokerInfo() { SelectPokerClear(); auto iter = m_allModulePoker.begin(); m_allSelectPokerInfo.m_banker.assign(iter, iter + 2); m_allSelectPokerInfo.m_tian.assign(iter + 2, iter + 4); m_allSelectPokerInfo.m_di.assign(iter + 4, iter + 6); m_allSelectPokerInfo.m_xuan.assign(iter + 6, iter + 8); m_allSelectPokerInfo.m_huang.assign(iter + 8, iter + 10); } void ALLPokerInfo::RandomLast3PokerInfo() { for (auto iter = m_allModulePoker.begin(); iter != m_allModulePoker.end(); iter++) { if (IsInSelectPokerInfo(*iter)) { continue; } if (m_allSelectPokerInfo.m_banker.size() < 5) { m_allSelectPokerInfo.m_banker.push_back(*iter); continue; } if (m_allSelectPokerInfo.m_tian.size() < 5) { m_allSelectPokerInfo.m_tian.push_back(*iter); continue; } if (m_allSelectPokerInfo.m_di.size() < 5) { m_allSelectPokerInfo.m_di.push_back(*iter); continue; } if (m_allSelectPokerInfo.m_xuan.size() < 5) { m_allSelectPokerInfo.m_xuan.push_back(*iter); continue; } if (m_allSelectPokerInfo.m_huang.size() < 5) { m_allSelectPokerInfo.m_huang.push_back(*iter); continue; } return; } } INT32 ALLPokerInfo::PlayerCompareBankerPokerInfo(vector<INT32> vecPoker) { enumPokerType playerType = GetPokerType(vecPoker); enumPokerType bankerType = GetPokerType(m_allSelectPokerInfo.m_banker); INT32 maxType = 0; if (playerType > bankerType) { maxType = playerType; } else if (playerType < bankerType) { maxType = -bankerType; } else { INT32 bankerPokerPoint = 0; INT32 bankerPokerType = 0; for (auto iter = m_allSelectPokerInfo.m_banker.begin(); iter != m_allSelectPokerInfo.m_banker.end(); iter++) { if (GetOnePokerPoint(*iter) > bankerPokerPoint) { bankerPokerPoint = GetOnePokerPoint(*iter); bankerPokerType = GetOnePokerType(*iter); } else if (GetOnePokerPoint(*iter) == bankerPokerPoint) { if (bankerPokerType > GetOnePokerType(*iter)) { bankerPokerType = GetOnePokerType(*iter); } } } INT32 playerPokerPoint = 0; INT32 playerPokerType = 0; for (auto iter = vecPoker.begin(); iter != vecPoker.end(); iter++) { if (GetOnePokerPoint(*iter) > playerPokerPoint) { playerPokerPoint = GetOnePokerPoint(*iter); playerPokerType = GetOnePokerType(*iter); } else if (GetOnePokerPoint(*iter) == playerPokerPoint) { if (playerPokerType > GetOnePokerType(*iter)) { playerPokerType = GetOnePokerType(*iter); } } } if (playerPokerPoint > bankerPokerPoint) { maxType = playerType; if (0 == maxType) { maxType = 1; } } else if (playerPokerPoint < bankerPokerPoint) { maxType = -bankerType; if (0 == maxType) { maxType = -1; } } else { if (playerPokerType < bankerPokerType) { maxType = playerType; if (0 == maxType) { maxType = 1; } } else { maxType = -bankerType; if (0 == maxType) { maxType = -1; } } } } if (abs(maxType) > 10) { maxType = maxType > 0 ? 10 : -10; } return maxType; } void ALLPokerInfo::ComparePokerInfo() { memset(m_allSelectPokerInfo.m_Bets, 0, sizeof(m_allSelectPokerInfo.m_Bets)); m_allSelectPokerInfo.m_Bets[0] = PlayerCompareBankerPokerInfo(m_allSelectPokerInfo.m_tian); m_allSelectPokerInfo.m_Bets[1] = PlayerCompareBankerPokerInfo(m_allSelectPokerInfo.m_di); m_allSelectPokerInfo.m_Bets[2] = PlayerCompareBankerPokerInfo(m_allSelectPokerInfo.m_xuan); m_allSelectPokerInfo.m_Bets[3] = PlayerCompareBankerPokerInfo(m_allSelectPokerInfo.m_huang); } void ALLPokerInfo::MatchingLast3PokerInfo(INT64 golds, INT64 tian, INT64 di, INT64 xuan, INT64 huang, bool isSystem) { const static INT32 loopCount = 100; static INT64 absMinGolds[loopCount]; memset(absMinGolds, 0, loopCount); static stOneGamePokerInfo absPokerInfo[loopCount]; for (INT32 i = 0; i < loopCount; i++) { absPokerInfo[i].m_banker.clear(); absPokerInfo[i].m_tian.clear(); absPokerInfo[i].m_di.clear(); absPokerInfo[i].m_xuan.clear(); absPokerInfo[i].m_huang.clear(); memset(absPokerInfo[i].m_Bets, 0, sizeof(absPokerInfo[i].m_Bets)); } for (INT32 i = 0; i < loopCount; i++) { ShufflePoker(); SelectPokerLastThreeClear(); RandomLast3PokerInfo(); ComparePokerInfo(); if (isSystem) { absMinGolds[i] = abs(golds - m_allSelectPokerInfo.m_Bets[0] * tian - m_allSelectPokerInfo.m_Bets[1] * di - m_allSelectPokerInfo.m_Bets[2] * xuan - m_allSelectPokerInfo.m_Bets[3] * huang); } else { absMinGolds[i] = abs(golds + m_allSelectPokerInfo.m_Bets[0] * tian + m_allSelectPokerInfo.m_Bets[1] * di + m_allSelectPokerInfo.m_Bets[2] * xuan + m_allSelectPokerInfo.m_Bets[3] * huang); } absPokerInfo[i] = m_allSelectPokerInfo; } INT32 minIndex = 0; INT64 minAbsGolds = absMinGolds[0]; for (INT32 i = 0; i < loopCount; i++) { if (minAbsGolds > absMinGolds[i]) { minIndex = i; minAbsGolds = absMinGolds[i]; } } m_allSelectPokerInfo = absPokerInfo[minIndex]; } bool ALLPokerInfo::IsInSelectPokerInfo(INT32 pokerInfo) { for (auto iter = m_allSelectPokerInfo.m_banker.begin(); iter != m_allSelectPokerInfo.m_banker.end(); iter++) { if (*iter == pokerInfo) { return true; } } for (auto iter = m_allSelectPokerInfo.m_tian.begin(); iter != m_allSelectPokerInfo.m_tian.end(); iter++) { if (*iter == pokerInfo) { return true; } } for (auto iter = m_allSelectPokerInfo.m_di.begin(); iter != m_allSelectPokerInfo.m_di.end(); iter++) { if (*iter == pokerInfo) { return true; } } for (auto iter = m_allSelectPokerInfo.m_xuan.begin(); iter != m_allSelectPokerInfo.m_xuan.end(); iter++) { if (*iter == pokerInfo) { return true; } } for (auto iter = m_allSelectPokerInfo.m_huang.begin(); iter != m_allSelectPokerInfo.m_huang.end(); iter++) { if (*iter == pokerInfo) { return true; } } return false; } enumPokerType ALLPokerInfo::GetPokerType(vector<INT32> vecPoker) { if(vecPoker.size() != 5) { return CATTLE_NONE; } if (GetPokerType5SmallCattle(vecPoker)) { return CATTLE_5SMALL; } if (GetPokerTypeGoldCattle(vecPoker)) { return CATTLE_GOLD; } if (GetPokerTypeBombCattle(vecPoker)) { return CATTLE_BOMB; } return enumPokerType(GetPokerTypeCattleBetweenZeroAndTen(vecPoker)); } bool ALLPokerInfo::GetPokerType5SmallCattle(vector<INT32> vecPoker) { INT32 allPokerPointSum = 0; for (auto iter = vecPoker.begin(); iter != vecPoker.end(); ++iter) { INT32 poker = GetOnePokerPoint(*iter); if (poker >= 5) { return false; } allPokerPointSum += poker; } if (allPokerPointSum > 10) { return false; } return true; } bool ALLPokerInfo::GetPokerTypeGoldCattle(vector<INT32> vecPoker) { for (auto iter = vecPoker.begin(); iter != vecPoker.end(); ++iter) { if (GetOnePokerPoint(*iter) <= 10) { return false; } } return true; } bool ALLPokerInfo::GetPokerTypeBombCattle(vector<INT32> vecPoker) { map<INT32, INT32> mapPokerPointCount; mapPokerPointCount.clear(); for (auto iter = vecPoker.begin(); iter != vecPoker.end(); ++iter) { auto iterFind = mapPokerPointCount.find(*iter); if (iterFind == mapPokerPointCount.end()) { mapPokerPointCount[*iter] = 0; } mapPokerPointCount[*iter] = mapPokerPointCount[*iter] + 1; } for (auto iter = mapPokerPointCount.begin(); iter != mapPokerPointCount.end(); ++iter) { if (4 == iter->second) { return true; } } return false; } static vector<vector<INT32>> FiveChooseThree(vector<INT32> vecPoker) { vector<vector<INT32>> allPokerPossibility; allPokerPossibility.clear(); vector<INT32> vecPoint; vecPoint.clear(); vecPoint = vecPoker; allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[3]); vecPoint.push_back(vecPoker[2]); vecPoint.push_back(vecPoker[4]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[4]); vecPoint.push_back(vecPoker[2]); vecPoint.push_back(vecPoker[3]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[2]); vecPoint.push_back(vecPoker[3]); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[4]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[2]); vecPoint.push_back(vecPoker[4]); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[3]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[3]); vecPoint.push_back(vecPoker[4]); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[2]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[2]); vecPoint.push_back(vecPoker[3]); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[4]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[2]); vecPoint.push_back(vecPoker[4]); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[3]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[1]); vecPoint.push_back(vecPoker[3]); vecPoint.push_back(vecPoker[4]); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[2]); allPokerPossibility.push_back(vecPoint); vecPoint.clear(); vecPoint.push_back(vecPoker[2]); vecPoint.push_back(vecPoker[3]); vecPoint.push_back(vecPoker[4]); vecPoint.push_back(vecPoker[0]); vecPoint.push_back(vecPoker[1]); allPokerPossibility.push_back(vecPoint); return allPokerPossibility; } INT32 ALLPokerInfo::GetPokerTypeCattleBetweenZeroAndTen(vector<INT32> vecPoker) { INT32 maxCattle = 0; vector<vector<INT32>> allPokerPossibility = FiveChooseThree(vecPoker); for (auto iter = allPokerPossibility.begin(); iter != allPokerPossibility.end(); ++iter) { INT32 threeSum = GetOnePokerPointBetween1And10((*iter)[0]) + GetOnePokerPointBetween1And10((*iter)[1]) + GetOnePokerPointBetween1And10((*iter)[2]); if (0 == threeSum % 10) { INT32 twoSum = GetOnePokerPointBetween1And10((*iter)[3]) + GetOnePokerPointBetween1And10((*iter)[4]); if (twoSum == 10 || twoSum == 20) { maxCattle = 10; } else { if (twoSum % 10 > maxCattle) { maxCattle = twoSum % 10; } } } } return maxCattle; }
//状态机
INT32 CGSGameRoom::OnGameRoomState(){ TIME_SECOND tCurTime = WYYTools_Instance->GetCurSecond(); if (m_eGameRoomState == eGameRoomState_Init) { if (g_cGSGameHallInstance.GetModelStatus() == eModelStatus_Working) { m_eGameRoomState = eGameRoomState_Send2Poker; m_stateOutTime = tCurTime + c_n32Send2PokerTime; GameRoomState_Send2Poker(); } } else if (m_eGameRoomState == eGameRoomState_Send2Poker) { if (tCurTime >= m_stateOutTime) { m_eGameRoomState = eGameRoomState_Beting; m_stateOutTime = tCurTime + c_n32BetingTime; NotifySceneUserState(NULL); } } else if (m_eGameRoomState == eGameRoomState_Beting) { if (tCurTime >= m_stateOutTime) { m_eGameRoomState = eGameRoomState_SendLast3Poker; m_stateOutTime = tCurTime + c_n32SendLast3PokerTime; GameRoomState_SendLast3Poker(); } } else if (m_eGameRoomState == eGameRoomState_SendLast3Poker) { if (tCurTime >= m_stateOutTime) { m_eGameRoomState = eGameRoomState_Result; m_stateOutTime = tCurTime + c_n32ResultTime; GameRoomState_CalcResult(); } } else if (m_eGameRoomState == eGameRoomState_Result) { if (tCurTime >= m_stateOutTime) { // 0 = 不操作 1 = 询问补庄 2 = 换庄 INT32 bankerState = JudgeChangeBanker(); m_BankerTiaoZhengChips = 0; if (1 == bankerState) { m_eGameRoomState = eGameRoomState_RoundBanker; m_stateOutTime = tCurTime + c_n32RoundBanker; GameRoomState_RoundBanker(bankerState); } else if (2 == bankerState) { m_eGameRoomState = eGameRoomState_ChangeBanker; m_stateOutTime = tCurTime + c_n32ChangeBanker; GameRoomState_ChangeBanker(); } else { m_eGameRoomState = eGameRoomState_ContinueBanker; m_stateOutTime = tCurTime + c_n32IsContinueBanker; GameRoomState_RoundBanker(bankerState); //m_eGameRoomState = eGameRoomState_Send2Poker; //m_stateOutTime = tCurTime + c_n32Send2PokerTime; //GameRoomState_Send2Poker(); } } } else if (m_eGameRoomState == eGameRoomState_RoundBanker) { if (tCurTime >= m_stateOutTime) { m_eGameRoomState = eGameRoomState_ChangeBanker; m_stateOutTime = tCurTime + c_n32ChangeBanker; GameRoomState_ChangeBanker(); } } else if (m_eGameRoomState == eGameRoomState_ContinueBanker) { if (tCurTime >= m_stateOutTime) { m_eGameRoomState = eGameRoomState_ChangeBanker; m_stateOutTime = tCurTime + c_n32ChangeBanker; GameRoomState_ChangeBanker(); } } else if (m_eGameRoomState == eGameRoomState_ChangeBanker) { if (tCurTime >= m_stateOutTime) { m_eGameRoomState = eGameRoomState_Send2Poker; m_stateOutTime = tCurTime + c_n32Send2PokerTime; GameRoomState_Send2Poker(); } } return 0; }
//先发2张牌,下注,再发三张牌
void CGSGameRoom::GameRoomState_Send2Poker() { m_allPokerInfo.SelectPokerClear(); m_allPokerInfo.ShufflePoker(); m_allPokerInfo.Random2PokerInfo(); m_AllBets.vecTianGolds.clear(); m_AllBets.vecDiGolds.clear(); m_AllBets.vecXuanGolds.clear(); m_AllBets.vecHuangGolds.clear(); m_GameUserBets.clear(); m_SynFlyGameUserBets.clear(); NotifySceneUserState(NULL); NotifySceneUserPokerInfo(0, 2, NULL); } void CGSGameRoom::MatchingLast3PokerInfo() { INT64 tianGolds = 0; INT64 diGolds = 0; INT64 xuanGolds = 0; INT64 huangGolds = 0; CGSGameUser* pGameUser = g_cGSGameHallInstance.GetCGSGameUserByID(m_BankerUserID); if (NULL != pGameUser) { for (auto iter = m_GameUserBets.begin(); iter != m_GameUserBets.end(); iter++) { if (UserIDInRobotVec(iter->first)) { tianGolds += iter->second.tianGolds; diGolds += iter->second.diGolds;; xuanGolds += iter->second.xuanGolds;; huangGolds += iter->second.haungGolds; } } INT64 winGolds = g_cGSGameHallInstance.SelectPlan(4) * (tianGolds + diGolds + xuanGolds + huangGolds) / 10000; m_allPokerInfo.MatchingLast3PokerInfo(winGolds, tianGolds, diGolds, xuanGolds, huangGolds, false); } else { for (auto iter = m_GameUserBets.begin(); iter != m_GameUserBets.end(); iter++) { if (!UserIDInRobotVec(iter->first)) { tianGolds += iter->second.tianGolds; diGolds += iter->second.diGolds;; xuanGolds += iter->second.xuanGolds;; huangGolds += iter->second.haungGolds; } } INT64 winGolds = g_cGSGameHallInstance.SelectPlan(4) * (tianGolds + diGolds + xuanGolds + huangGolds) / 10000; m_allPokerInfo.MatchingLast3PokerInfo(winGolds, tianGolds, diGolds, xuanGolds, huangGolds, true); } m_awardRecords.push_back(m_allPokerInfo); while (m_awardRecords.size() > 20) { m_awardRecords.erase(m_awardRecords.begin()); } }
根据血池,玩家下注情况,选择相应策略,根据策略给庄家和天地玄黄配牌,把所有玩家放在一起统一处理输赢
策略的json
[{ "threshold": 0, "info": [{ "plan": -100000, "weights": 150 }, { "plan": -71600, "weights": 350 }, { "plan": -50505, "weights": 650 }, { "plan": -31300, "weights": 850 }, { "plan": -10800, "weights": 1000 }, { "plan": 18300, "weights": 200 }, { "plan": 25500, "weights": 600 }, { "plan": 31500, "weights": 600 }, { "plan": 45500, "weights": 1000 }, { "plan": 53500, "weights": 800 }, { "plan": 62800, "weights": 700 }, { "plan": 74700, "weights": 900 }, { "plan": 82840, "weights": 700 }, { "plan": 92500, "weights": 700 }, { "plan": 100000, "weights": 800 }] }, { "threshold": 50000000, "info": [{ "plan": -100000, "weights": 200 }, { "plan": -71000, "weights": 200 }, { "plan": -61600, "weights": 400 }, { "plan": -52000, "weights": 600 }, { "plan": -31500, "weights": 800 }, { "plan": -12500, "weights": 1400 }, { "plan": -6310, "weights": 1400 }, { "plan": 25000, "weights": 100 }, { "plan": 33300, "weights": 100 }, { "plan": 40100, "weights": 400 }, { "plan": 50500, "weights": 800 }, { "plan": 62500, "weights": 1000 }, { "plan": 75600, "weights": 800 }, { "plan": 88000, "weights": 1000 }, { "plan": 10000, "weights": 800 }] }, { "threshold": 100000000, "info": [{ "plan": -100000, "weights": 200 }, { "plan": -95270, "weights": 400 }, { "plan": -81848, "weights": 400 }, { "plan": -70842, "weights": 600 }, { "plan": -50505, "weights": 800 }, { "plan": -45000, "weights": 1000 }, { "plan": -23000, "weights": 1200 }, { "plan": -12000, "weights": 1400 }, { "plan": 33300, "weights": 100 }, { "plan": 40100, "weights": 100 }, { "plan": 50505, "weights": 200 }, { "plan": 62500, "weights": 600 }, { "plan": 82840, "weights": 1000 }, { "plan": 92500, "weights": 1200 }, { "plan": 100000, "weights": 800 }] }, { "threshold": 500000000, "info": [{ "plan": -100000, "weights": 400 }, { "plan": -82840, "weights": 600 }, { "plan": -70747, "weights": 600 }, { "plan": -42300, "weights": 600 }, { "plan": -31300, "weights": 1200 }, { "plan": -21400, "weights": 1200 }, { "plan": -10600, "weights": 1400 }, { "plan": 11500, "weights": 600 }, { "plan": 20400, "weights": 600 }, { "plan": 32000, "weights": 400 }, { "plan": 47500, "weights": 400 }, { "plan": 62500, "weights": 400 }, { "plan": 75600, "weights": 600 }, { "plan": 88000, "weights": 600 }, { "plan": 100000, "weights": 400 }] }, { "threshold": 1000000000, "info": [{ "plan": -100000, "weights": 600 }, { "plan": -95270, "weights": 800 }, { "plan": -85000, "weights": 600 }, { "plan": -74800, "weights": 600 }, { "plan": -50500, "weights": 1200 }, { "plan": -36700, "weights": 1200 }, { "plan": -11500, "weights": 1000 }, { "plan": 20400, "weights": 400 }, { "plan": 32000, "weights": 400 }, { "plan": 42300, "weights": 500 }, { "plan": 52013, "weights": 400 }, { "plan": 75600, "weights": 500 }, { "plan": 82840, "weights": 600 }, { "plan": 95500, "weights": 600 }, { "plan": 100000, "weights": 600 }] }, { "threshold": 2500000000, "info": [{ "plan": -100000, "weights": 800 }, { "plan": -95270, "weights": 800 }, { "plan": -82840, "weights": 200 }, { "plan": -50500, "weights": 500000 }, { "plan": -41600, "weights": 800 }, { "plan": -34300, "weights": 1500 }, { "plan": -20100, "weights": 1600 }, { "plan": -10000, "weights": 1800 }, { "plan": 21200, "weights": 25 }, { "plan": 42300, "weights": 25 }, { "plan": 63915, "weights": 50 }, { "plan": 74088, "weights": 50 }, { "plan": 82840, "weights": 150 }, { "plan": 92900, "weights": 850 }, { "plan": 100000, "weights": 8500 }] }]