Reformatting code using Kernighan & Ritchie style, tabs, tab width=4.

Command line: astyle --style=kr --indent=force-tab=4 --lineend=linux -n -r <file names>
This commit is contained in:
lotodore
2011-02-11 20:02:08 +00:00
parent 29dca1846e
commit 02518c67b2
232 changed files with 22743 additions and 21044 deletions
+290 -275
View File
@@ -31,8 +31,8 @@
using namespace std;
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), lastActionPlayer(0), allInCondition(false),
cardsShown(false), bettingRoundsPlayed(0)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), lastActionPlayer(0), allInCondition(false),
cardsShown(false), bettingRoundsPlayed(0)
{
int i, j, k;
@@ -94,19 +94,19 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEBUGGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
if(DEBUG_MODE) {
if(DEBUG_MODE) {
//QSqlDatabase *mySqliteLogDb;
//QSqlDatabase *mySqliteLogDb;
// myGui->getMyW()->getSession();
// myGui->getMyW()->getSession();
//QSqlDatabase * test = myGui->getMyLog()->getMySqliteLogDb();
//QSqlDatabase * test = myGui->getMyLog()->getMySqliteLogDb();
// if(!mySqliteLogDb->open()) {
// QMessageBox::critical(0, tr("ERROR"),mySqliteLogDb->lastError().text().toUtf8().data(), QMessageBox::Cancel);
// }
// if(!mySqliteLogDb->open()) {
// QMessageBox::critical(0, tr("ERROR"),mySqliteLogDb->lastError().text().toUtf8().data(), QMessageBox::Cancel);
// }
@@ -114,237 +114,240 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
switch(myID) {
case 1: {
case 1: {
tempBoardArray[0] = 4;
tempBoardArray[1] = 19;
tempBoardArray[2] = 20;
tempBoardArray[3] = 43;
tempBoardArray[4] = 49;
myBoard->setMyCards(tempBoardArray);
tempPlayerAndBoardArray[2] = tempBoardArray[0];
tempPlayerAndBoardArray[3] = tempBoardArray[1];
tempPlayerAndBoardArray[4] = tempBoardArray[2];
tempPlayerAndBoardArray[5] = tempBoardArray[3];
tempPlayerAndBoardArray[6] = tempBoardArray[4];
// player0
it = seatsList->begin();
tempPlayerArray[0] = 18;
tempPlayerArray[1] = 17;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
tempBoardArray[0] = 4;
tempBoardArray[1] = 19;
tempBoardArray[2] = 20;
tempBoardArray[3] = 43;
tempBoardArray[4] = 49;
// player1
++it;
tempPlayerArray[0] = 31;
tempPlayerArray[1] = 8;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player2
++it;
tempPlayerArray[0] = 26;
tempPlayerArray[1] = 27;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player3
++it;
tempPlayerArray[0] = 31;
tempPlayerArray[1] = 30;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
myBoard->setMyCards(tempBoardArray);
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
tempPlayerAndBoardArray[2] = tempBoardArray[0];
tempPlayerAndBoardArray[3] = tempBoardArray[1];
tempPlayerAndBoardArray[4] = tempBoardArray[2];
tempPlayerAndBoardArray[5] = tempBoardArray[3];
tempPlayerAndBoardArray[6] = tempBoardArray[4];
(*it)->setMyBestHandPosition(temp5Array);
// player0
it = seatsList->begin();
// player4
++it;
tempPlayerArray[0] = 50;
tempPlayerArray[1] = 51;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
tempPlayerArray[0] = 18;
tempPlayerArray[1] = 17;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
// player5
++it;
tempPlayerArray[0] = 25;
tempPlayerArray[1] = 24;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
(*it)->setMyBestHandPosition(temp5Array);
// player1
++it;
// player6
++it;
tempPlayerArray[0] = 38;
tempPlayerArray[1] = 37;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
tempPlayerArray[0] = 31;
tempPlayerArray[1] = 8;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
// player7
++it;
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
tempPlayerArray[0] = 32;
tempPlayerArray[1] = 33;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyBestHandPosition(temp5Array);
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
// player2
++it;
(*it)->setMyBestHandPosition(temp5Array);
tempPlayerArray[0] = 26;
tempPlayerArray[1] = 27;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
// player8
++it;
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
tempPlayerArray[0] = 19;
tempPlayerArray[1] = 20;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyBestHandPosition(temp5Array);
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
// player3
++it;
(*it)->setMyBestHandPosition(temp5Array);
tempPlayerArray[0] = 31;
tempPlayerArray[1] = 30;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player4
++it;
tempPlayerArray[0] = 50;
tempPlayerArray[1] = 51;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player5
++it;
tempPlayerArray[0] = 25;
tempPlayerArray[1] = 24;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player6
++it;
tempPlayerArray[0] = 38;
tempPlayerArray[1] = 37;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player7
++it;
tempPlayerArray[0] = 32;
tempPlayerArray[1] = 33;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player8
++it;
tempPlayerArray[0] = 19;
tempPlayerArray[1] = 20;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
} break;
case 2: {
/* tempBoardArray[0] = 48;
tempBoardArray[1] = 21;
tempBoardArray[2] = 4;
tempBoardArray[3] = 9;
tempBoardArray[4] = 0;
myBoard->setMyCards(tempBoardArray);
tempPlayerAndBoardArray[2] = tempBoardArray[0];
tempPlayerAndBoardArray[3] = tempBoardArray[1];
tempPlayerAndBoardArray[4] = tempBoardArray[2];
tempPlayerAndBoardArray[5] = tempBoardArray[3];
tempPlayerAndBoardArray[6] = tempBoardArray[4];*/
// player0
it = seatsList->begin();
}
break;
case 2: {
/* tempBoardArray[0] = 48;
tempBoardArray[1] = 21;
tempBoardArray[2] = 4;
tempBoardArray[3] = 9;
tempBoardArray[4] = 0;
myBoard->setMyCards(tempBoardArray);
tempPlayerAndBoardArray[2] = tempBoardArray[0];
tempPlayerAndBoardArray[3] = tempBoardArray[1];
tempPlayerAndBoardArray[4] = tempBoardArray[2];
tempPlayerAndBoardArray[5] = tempBoardArray[3];
tempPlayerAndBoardArray[6] = tempBoardArray[4];*/
// player0
it = seatsList->begin();
// tempPlayerArray[0] = 9;
// tempPlayerArray[1] = 5;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
//
// (*it)->setMyBestHandPosition(temp5Array);
// player1
++it;
// player1
++it;
// tempPlayerArray[0] = 47;
// tempPlayerArray[1] = 22;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
//
// (*it)->setMyBestHandPosition(temp5Array);
// player2
++it;
// player2
++it;
// tempPlayerArray[0] = 33;
// tempPlayerArray[1] = 27;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
//
// (*it)->setMyBestHandPosition(temp5Array);
// player3
++it;
// player3
++it;
// tempPlayerArray[0] = 38;
// tempPlayerArray[1] = 22;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
//
// (*it)->setMyBestHandPosition(temp5Array);
// player4
++it;
// player4
++it;
// tempPlayerArray[0] = 25;
// tempPlayerArray[1] = 16;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
//
// (*it)->setMyBestHandPosition(temp5Array);
// player5
++it;
// player5
++it;
// tempPlayerArray[0] = 27;
// tempPlayerArray[1] = 10;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
//
// (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
//
// (*it)->setMyBestHandPosition(temp5Array);
} break;
default: {}
}
break;
default:
{}
}
@@ -356,7 +359,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
// determine dealer, SB, BB
assignButtons();
myLog->logNewHandMsg(myID, dealerPosition, smallBlind, smallBlindPosition, 2*smallBlind, bigBlindPosition, seatsList);
myLog->logNewHandMsg(myID, dealerPosition, smallBlind, smallBlindPosition, 2*smallBlind, bigBlindPosition, seatsList);
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
}
@@ -367,29 +370,32 @@ LocalHand::~LocalHand()
{
}
void LocalHand::start() {
void LocalHand::start()
{
//Log blinds sets for new Hand
PlayerListConstIterator it_sB, it_bB;
it_sB = getActivePlayerIt(getCurrentBeRo()->getSmallBlindPositionId());
it_bB = getActivePlayerIt(getCurrentBeRo()->getBigBlindPositionId());
if(it_sB != getActivePlayerList()->end() && it_bB != getActivePlayerList()->end()) {
myGui->logNewBlindsSetsMsg((*it_sB)->getMySet(), (*it_bB)->getMySet(), (*it_sB)->getMyName().c_str(), (*it_bB)->getMyName().c_str());
}
else { LOG_ERROR(__FILE__ << " (" << __LINE__ << "): Log Error: cannot find sBID or bBID"); }
myGui->flushLogAtHand();
myGui->logNewBlindsSetsMsg((*it_sB)->getMySet(), (*it_bB)->getMySet(), (*it_sB)->getMyName().c_str(), (*it_bB)->getMyName().c_str());
} else {
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): Log Error: cannot find sBID or bBID");
}
myGui->flushLogAtHand();
// deal cards
myGui->dealHoleCards();
getBoard()->collectSets();
getGuiInterface()->refreshPot();
// change rounds | first start preflop
myGui->nextPlayerAnimation();
}
void LocalHand::assignButtons() {
void LocalHand::assignButtons()
{
size_t i;
PlayerListIterator it;
@@ -424,33 +430,33 @@ void LocalHand::assignButtons() {
it = getActivePlayerIt( (*dealerPositionIt)->getMyUniqueID() );
if(it != activePlayerList->end() ) {
nextActivePlayerFound = true;
if(activePlayerList->size() > 2) {
//small blind normal
(*it)->setMyButton(2);
smallBlindPosition = (*it)->getMyUniqueID();
} else {
//big blind in heads up
(*it)->setMyButton(3);
bigBlindPosition = (*it)->getMyUniqueID();
// lastPlayerAction for showing cards
}
if(activePlayerList->size() > 2) {
//small blind normal
(*it)->setMyButton(2);
smallBlindPosition = (*it)->getMyUniqueID();
} else {
//big blind in heads up
(*it)->setMyButton(3);
bigBlindPosition = (*it)->getMyUniqueID();
// lastPlayerAction for showing cards
}
// first player after dealer have to show his cards first (in showdown)
lastActionPlayer = (*it)->getMyUniqueID();
myBoard->setLastActionPlayer(lastActionPlayer);
// first player after dealer have to show his cards first (in showdown)
lastActionPlayer = (*it)->getMyUniqueID();
myBoard->setLastActionPlayer(lastActionPlayer);
++it;
if(it == activePlayerList->end()) it = activePlayerList->begin();
if(activePlayerList->size() > 2) {
//big blind normal
(*it)->setMyButton(3);
bigBlindPosition = (*it)->getMyUniqueID();
} else {
//small blind in heads up
(*it)->setMyButton(2);
smallBlindPosition = (*it)->getMyUniqueID();
}
if(activePlayerList->size() > 2) {
//big blind normal
(*it)->setMyButton(3);
bigBlindPosition = (*it)->getMyUniqueID();
} else {
//small blind in heads up
(*it)->setMyButton(2);
smallBlindPosition = (*it)->getMyUniqueID();
}
break;
}
@@ -466,7 +472,7 @@ void LocalHand::assignButtons() {
for (it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); ++it_c) {
//small blind
if((*it_c)->getMyButton() == BUTTON_SMALL_BLIND) {
if((*it_c)->getMyButton() == BUTTON_SMALL_BLIND) {
// All in ?
if((*it_c)->getMyCash() <= smallBlind) {
@@ -475,24 +481,22 @@ void LocalHand::assignButtons() {
// 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
}
else {
} else {
(*it_c)->setMySet(smallBlind);
}
}
//big blind
if((*it_c)->getMyButton() == BUTTON_BIG_BLIND) {
if((*it_c)->getMyButton() == BUTTON_BIG_BLIND) {
// all in ?
if((*it_c)->getMyCash() <= 2*smallBlind) {
(*it_c)->setMySet((*it_c)->getMyCash());
// 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
}
else {
} else {
(*it_c)->setMySet(2*smallBlind);
}
}
@@ -500,7 +504,8 @@ void LocalHand::assignButtons() {
}
void LocalHand::switchRounds() {
void LocalHand::switchRounds()
{
PlayerListIterator it, it_1;
PlayerListConstIterator it_c;
@@ -537,10 +542,10 @@ void LocalHand::switchRounds() {
// if only one player non-fold -> distribute pot
if(nonFoldPlayerCounter==1) {
myBoard->collectPot();
myBoard->collectPot();
myGui->refreshPot();
myGui->refreshSet();
currentRound = 4;
currentRound = 4;
}
// check for all in condition
@@ -550,7 +555,7 @@ void LocalHand::switchRounds() {
// 1) all players all in
if(allInPlayersCounter == nonFoldPlayerCounter) {
allInCondition = true;
myBoard->setAllInCondition(true);
myBoard->setAllInCondition(true);
}
// 2) all players but one all in and he has highest set
@@ -559,64 +564,64 @@ void LocalHand::switchRounds() {
for(it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); ++it_c) {
if((*it_c)->getMySet() >= myBeRo[currentRound]->getHighestSet()) {
allInCondition = true;
myBoard->setAllInCondition(true);
allInCondition = true;
myBoard->setAllInCondition(true);
}
}
// exception
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount and other all-in players with less than small blind are nonfold too -> preflop is over
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[currentRound]->getSmallBlindPositionId());
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[currentRound]->getBigBlindPositionId());
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && currentRound == GAME_STATE_PREFLOP && myBeRo[currentRound]->getFirstRound()) {
// determine player who are all in with less than small blind amount
int tempCounter = 0;
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if((*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMySet() <= smallBlind) {
tempCounter++;
}
}
if( (*bigBlindIt_c)->getMySet() <= smallBlind && tempCounter == allInPlayersCounter) {
allInCondition = true;
myBoard->setAllInCondition(true);
}
}
// no.2: heads up -> detect player who is all in and bb but could set less than sb
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount and other all-in players with less than small blind are nonfold too -> preflop is over
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[currentRound]->getSmallBlindPositionId());
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[currentRound]->getBigBlindPositionId());
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && currentRound == GAME_STATE_PREFLOP && myBeRo[currentRound]->getFirstRound()) {
// determine player who are all in with less than small blind amount
int tempCounter = 0;
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if(activePlayerList->size()==2 && (*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMyButton()==BUTTON_BIG_BLIND && (*it_c)->getMySet()<=smallBlind && currentRound == GAME_STATE_PREFLOP) {
allInCondition = true;
myBoard->setAllInCondition(true);
if((*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMySet() <= smallBlind) {
tempCounter++;
}
}
if( (*bigBlindIt_c)->getMySet() <= smallBlind && tempCounter == allInPlayersCounter) {
allInCondition = true;
myBoard->setAllInCondition(true);
}
}
// no.2: heads up -> detect player who is all in and bb but could set less than sb
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if(activePlayerList->size()==2 && (*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMyButton()==BUTTON_BIG_BLIND && (*it_c)->getMySet()<=smallBlind && currentRound == GAME_STATE_PREFLOP) {
allInCondition = true;
myBoard->setAllInCondition(true);
}
}
}
}
// special routine
if(allInCondition) {
myBoard->collectPot();
myBoard->collectPot();
myGui->refreshPot();
myGui->refreshSet();
myGui->flipHolecardsAllIn();
if (currentRound < 4) // do not increment past 4
currentRound++;
//log board cards for allin
if(currentRound >= 1) {
int tempBoardCardsArray[5];
myBoard->getMyCards(tempBoardCardsArray);
myGui->logDealBoardCardsMsg(currentRound, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]);
}
}
//unhighlight current players groupbox
it_c = getActivePlayerIt(lastPlayersTurn);
if( it_c != activePlayerList->end() ) {
if( it_c != activePlayerList->end() ) {
// lastPlayersTurn is active
myGui->refreshGroupbox(lastPlayersTurn,1);
}
@@ -624,38 +629,45 @@ void LocalHand::switchRounds() {
myGui->refreshGameLabels((GameState)getCurrentRound());
switch(currentRound) {
case 0: {
// start preflop
myGui->preflopAnimation1();
} break;
case 1: {
// start flop
myGui->flopAnimation1();
} break;
case 2: {
// start turn
myGui->turnAnimation1();
case 0: {
// start preflop
myGui->preflopAnimation1();
}
break;
case 1: {
// start flop
myGui->flopAnimation1();
}
break;
case 2: {
// start turn
myGui->turnAnimation1();
} break;
case 3: {
// start river
myGui->riverAnimation1();
}
break;
case 3: {
// start river
myGui->riverAnimation1();
} break;
case 4: {
// start post river
myGui->postRiverAnimation1();
}
break;
case 4: {
// start post river
myGui->postRiverAnimation1();
}
break;
default:
{}
} break;
default: {}
}
}
PlayerListIterator LocalHand::getSeatIt(unsigned uniqueId) const {
PlayerListIterator LocalHand::getSeatIt(unsigned uniqueId) const
{
PlayerListIterator it;
@@ -669,7 +681,8 @@ PlayerListIterator LocalHand::getSeatIt(unsigned uniqueId) const {
}
PlayerListIterator LocalHand::getActivePlayerIt(unsigned uniqueId) const {
PlayerListIterator LocalHand::getActivePlayerIt(unsigned uniqueId) const
{
PlayerListIterator it;
@@ -683,7 +696,8 @@ PlayerListIterator LocalHand::getActivePlayerIt(unsigned uniqueId) const {
}
PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const {
PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const
{
PlayerListIterator it;
@@ -698,7 +712,8 @@ PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const {
}
void LocalHand::setLastActionPlayer(unsigned theValue) {
lastActionPlayer = theValue;
myBoard->setLastActionPlayer(theValue);
void LocalHand::setLastActionPlayer(unsigned theValue)
{
lastActionPlayer = theValue;
myBoard->setLastActionPlayer(theValue);
}