Added winner list for network client.
This commit is contained in:
@@ -54,7 +54,7 @@ public:
|
||||
virtual void distributePot() =0;
|
||||
|
||||
virtual std::list<int> getWinners() const =0;
|
||||
|
||||
virtual void setWinners(const std::list<int> &winners) =0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ void LocalBoard::distributePot() {
|
||||
int highestCardsValue;
|
||||
size_t winnerCount;
|
||||
size_t mod;
|
||||
int winnerPointer;
|
||||
// int winnerPointer;
|
||||
bool winnerHit;
|
||||
|
||||
// level loop
|
||||
|
||||
@@ -52,7 +52,8 @@ public:
|
||||
void distributePot();
|
||||
|
||||
std::list<int> getWinners() const { return winners; }
|
||||
|
||||
void setWinners(const std::list<int> &w) { winners = w; }
|
||||
|
||||
|
||||
private:
|
||||
PlayerList seatsList;
|
||||
|
||||
@@ -121,7 +121,14 @@ ClientBoard::distributePot()
|
||||
std::list<int>
|
||||
ClientBoard::getWinners() const
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||
return winners;
|
||||
}
|
||||
|
||||
void
|
||||
ClientBoard::setWinners(const std::list<int> &w)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||
winners = w;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
void distributePot();
|
||||
|
||||
std::list<int> getWinners() const;
|
||||
void setWinners(const std::list<int> &winners);
|
||||
|
||||
private:
|
||||
mutable boost::recursive_mutex m_syncMutex;
|
||||
|
||||
@@ -1097,7 +1097,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
throw ClientException(__FILE__, __LINE__, ERR_NET_UNKNOWN_PLAYER_ID, 0);
|
||||
|
||||
tmpPlayer->setMyCash(endHandData.playerMoney);
|
||||
// TODO use moneyWon
|
||||
|
||||
curGame->getCurrentHand()->getBoard()->setPot(0);
|
||||
|
||||
client.GetGui().postRiverRunAnimation1();
|
||||
@@ -1125,6 +1125,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
NetPacketEndOfHandShowCards::PlayerResultList::const_iterator end
|
||||
= endHandData.playerResults.end();
|
||||
|
||||
list<int> winnerList;
|
||||
int highestValueOfCards = 0;
|
||||
while (i != end)
|
||||
{
|
||||
@@ -1144,11 +1145,14 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
if (tmpPlayer->getMyCardsValueInt() > highestValueOfCards)
|
||||
highestValueOfCards = tmpPlayer->getMyCardsValueInt();
|
||||
tmpPlayer->setMyCash((*i).playerMoney);
|
||||
// TODO use moneyWon
|
||||
|
||||
if ((*i).moneyWon)
|
||||
winnerList.push_back((*i).playerId);
|
||||
++i;
|
||||
}
|
||||
curGame->getCurrentHand()->getCurrentBeRo()->setHighestCardsValue(highestValueOfCards);
|
||||
curGame->getCurrentHand()->getBoard()->setPot(0);
|
||||
curGame->getCurrentHand()->getBoard()->setWinners(winnerList);
|
||||
|
||||
client.GetGui().postRiverRunAnimation1();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user