implement frame for list of player who need to show their cards at the end of the hand
This commit is contained in:
@@ -52,10 +52,14 @@ public:
|
|||||||
virtual void collectPot() =0;
|
virtual void collectPot() =0;
|
||||||
|
|
||||||
virtual void distributePot() =0;
|
virtual void distributePot() =0;
|
||||||
|
virtual void determinePlayerNeedToShowCards() =0;
|
||||||
|
|
||||||
virtual std::list<unsigned> getWinners() const =0;
|
virtual std::list<unsigned> getWinners() const =0;
|
||||||
virtual void setWinners(const std::list<unsigned> &winners) =0;
|
virtual void setWinners(const std::list<unsigned> &winners) =0;
|
||||||
|
|
||||||
|
virtual std::list<unsigned> getPlayerNeedToShowCards() const =0;
|
||||||
|
virtual void setPlayerNeedToShowCards(const std::list<unsigned> &playerNeedToShowCards) =0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ void LocalBeRoPostRiver::postRiverRun() {
|
|||||||
|
|
||||||
//Pot auf 0 setzen
|
//Pot auf 0 setzen
|
||||||
getMyHand()->getBoard()->setPot(0);
|
getMyHand()->getBoard()->setPot(0);
|
||||||
|
|
||||||
|
// Spieler ermitteln, welche die Karten auf jeden Fall umdrehen müssen
|
||||||
|
getMyHand()->getBoard()->determinePlayerNeedToShowCards();
|
||||||
|
|
||||||
//starte die Animaionsreihe
|
//starte die Animaionsreihe
|
||||||
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
|
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
|
||||||
|
|||||||
@@ -236,3 +236,42 @@ void LocalBoard::distributePot() {
|
|||||||
sum += (*it_c)->getMyCash();
|
sum += (*it_c)->getMyCash();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocalBoard::determinePlayerNeedToShowCards() {
|
||||||
|
|
||||||
|
// all winners have to show their cards
|
||||||
|
playerNeedToShowCards = winners;
|
||||||
|
|
||||||
|
// // the player who has done the last action has to show his cards first
|
||||||
|
// playerNeedToShowCards.push_back(currentHand->getCurrentBeRo()->getLastActionPlayer());
|
||||||
|
//
|
||||||
|
// // get position und cardsValue of the player who show his cards first
|
||||||
|
// PlayerListConstIterator lastActionPlayerIt = currentHand->getActivePlayerIt(currentHand->getCurrentBeRo()->getLastActionPlayer());
|
||||||
|
// int highestCardsValueInt = (*lastActionPlayerIt)->getMyCardsValueInt();
|
||||||
|
//
|
||||||
|
// // search for more player who have to show their cards (perhaps not all situation are considered yet)
|
||||||
|
// PlayerListConstIterator it_c;
|
||||||
|
// for(it_c = ++lastActionPlayerIt; it_c!=activePlayerList->end(); it_c++) {
|
||||||
|
// if((*it_c)->getMyCardsValueInt() >= highestCardsValueInt) {
|
||||||
|
// playerNeedToShowCards.push_back((*it_c)->getMyUniqueID());
|
||||||
|
// highestCardsValueInt = (*it_c)->getMyCardsValueInt();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for(it_c = activePlayerList->begin(); it_c!=lastActionPlayerIt; it_c++) {
|
||||||
|
// if((*it_c)->getMyCardsValueInt() >= highestCardsValueInt) {
|
||||||
|
// playerNeedToShowCards.push_back((*it_c)->getMyUniqueID());
|
||||||
|
// highestCardsValueInt = (*it_c)->getMyCardsValueInt();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // sort and unique the list
|
||||||
|
// playerNeedToShowCards.sort();
|
||||||
|
// playerNeedToShowCards.unique();
|
||||||
|
//
|
||||||
|
// for(it_c = activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||||
|
// cout << (*it_c)->getMyUniqueID() << '\t';
|
||||||
|
// }
|
||||||
|
// cout << endl;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,10 +50,14 @@ public:
|
|||||||
void collectPot() ;
|
void collectPot() ;
|
||||||
|
|
||||||
void distributePot();
|
void distributePot();
|
||||||
|
void determinePlayerNeedToShowCards();
|
||||||
|
|
||||||
std::list<unsigned> getWinners() const { return winners; }
|
std::list<unsigned> getWinners() const { return winners; }
|
||||||
void setWinners(const std::list<unsigned> &w) { winners = w; }
|
void setWinners(const std::list<unsigned> &w) { winners = w; }
|
||||||
|
|
||||||
|
std::list<unsigned> getPlayerNeedToShowCards() const { return playerNeedToShowCards; }
|
||||||
|
void setPlayerNeedToShowCards(const std::list<unsigned> &p) { playerNeedToShowCards = p; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PlayerList seatsList;
|
PlayerList seatsList;
|
||||||
@@ -63,6 +67,7 @@ private:
|
|||||||
HandInterface *currentHand;
|
HandInterface *currentHand;
|
||||||
|
|
||||||
std::list<unsigned> winners;
|
std::list<unsigned> winners;
|
||||||
|
std::list<unsigned> playerNeedToShowCards;
|
||||||
|
|
||||||
int myCards[5];
|
int myCards[5];
|
||||||
int pot;
|
int pot;
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ private:
|
|||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
BoardInterface *myBoard;
|
BoardInterface *myBoard;
|
||||||
|
|
||||||
PlayerList seatsList;
|
PlayerList seatsList; // all player
|
||||||
PlayerList activePlayerList;
|
PlayerList activePlayerList; // all player who are not folded and not out
|
||||||
PlayerList runningPlayerList;
|
PlayerList runningPlayerList; // all player who are not folded, not all in and not out
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,12 @@ ClientBoard::distributePot()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBoard::determinePlayerNeedToShowCards()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::list<unsigned>
|
std::list<unsigned>
|
||||||
ClientBoard::getWinners() const
|
ClientBoard::getWinners() const
|
||||||
{
|
{
|
||||||
@@ -132,3 +138,16 @@ ClientBoard::setWinners(const std::list<unsigned> &w)
|
|||||||
winners = w;
|
winners = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::list<unsigned>
|
||||||
|
ClientBoard::getPlayerNeedToShowCards() const
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
return playerNeedToShowCards;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ClientBoard::setPlayerNeedToShowCards(const std::list<unsigned> &p)
|
||||||
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
|
playerNeedToShowCards = p;
|
||||||
|
}
|
||||||
|
|||||||
@@ -49,10 +49,14 @@ public:
|
|||||||
void collectPot();
|
void collectPot();
|
||||||
|
|
||||||
void distributePot();
|
void distributePot();
|
||||||
|
void determinePlayerNeedToShowCards();
|
||||||
|
|
||||||
std::list<unsigned> getWinners() const;
|
std::list<unsigned> getWinners() const;
|
||||||
void setWinners(const std::list<unsigned> &winners);
|
void setWinners(const std::list<unsigned> &winners);
|
||||||
|
|
||||||
|
std::list<unsigned> getPlayerNeedToShowCards() const;
|
||||||
|
void setPlayerNeedToShowCards(const std::list<unsigned> &playerNeedToShowCards);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable boost::recursive_mutex m_syncMutex;
|
mutable boost::recursive_mutex m_syncMutex;
|
||||||
|
|
||||||
@@ -63,6 +67,7 @@ private:
|
|||||||
HandInterface *currentHand;
|
HandInterface *currentHand;
|
||||||
|
|
||||||
std::list<unsigned> winners;
|
std::list<unsigned> winners;
|
||||||
|
std::list<unsigned> playerNeedToShowCards;
|
||||||
|
|
||||||
int myCards[5];
|
int myCards[5];
|
||||||
int pot;
|
int pot;
|
||||||
|
|||||||
Reference in New Issue
Block a user