From 6e795d99d55b7b59fa740ea6b5e3d9d84ebc7bd6 Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 29 Sep 2007 17:08:05 +0000 Subject: [PATCH] adds activePlayerList and runningPlayerList (XXV) - bugfixes --- src/engine/local_engine/localhand.cpp | 41 +++++++++++------ src/engine/local_engine/localplayer.cpp | 56 ++++++++++++++++++------ src/game.cpp | 2 +- src/gui/qt/mainwindow/log/log.cpp | 2 +- src/gui/qt/mainwindow/mainwindowimpl.cpp | 4 +- 5 files changed, 74 insertions(+), 31 deletions(-) diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 89516c03..a3e8e7dd 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -112,10 +112,10 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI case 1: { -/* tempBoardArray[0] = 27; - tempBoardArray[1] = 37; - tempBoardArray[2] = 45; - tempBoardArray[3] = 51; + tempBoardArray[0] = 22; + tempBoardArray[1] = 15; + tempBoardArray[2] = 24; + tempBoardArray[3] = 30; tempBoardArray[4] = 23; myBoard->setMyCards(tempBoardArray); @@ -124,7 +124,7 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI tempPlayerAndBoardArray[3] = tempBoardArray[1]; tempPlayerAndBoardArray[4] = tempBoardArray[2]; tempPlayerAndBoardArray[5] = tempBoardArray[3]; - tempPlayerAndBoardArray[6] = tempBoardArray[4];*/ + tempPlayerAndBoardArray[6] = tempBoardArray[4]; // player0 it = seatsList->begin(); @@ -155,15 +155,15 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI // player2 it++; -// tempPlayerArray[0] = 25; -// tempPlayerArray[1] = 36; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); + tempPlayerArray[0] = 35; + tempPlayerArray[1] = 18; + tempPlayerAndBoardArray[0] = tempPlayerArray[0]; + tempPlayerAndBoardArray[1] = tempPlayerArray[1]; + + (*it)->setMyCards(tempPlayerArray); + (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); + + (*it)->setMyBestHandPosition(temp5Array); // player3 it++; @@ -204,6 +204,19 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI // // (*it)->setMyBestHandPosition(temp5Array); + // player6 + it++; + + tempPlayerArray[0] = 13; + tempPlayerArray[1] = 49; + tempPlayerAndBoardArray[0] = tempPlayerArray[0]; + tempPlayerAndBoardArray[1] = tempPlayerArray[1]; + + (*it)->setMyCards(tempPlayerArray); + (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); + + (*it)->setMyBestHandPosition(temp5Array); + } break; case 2: { diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index b554ceca..7e6ea680 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -860,22 +860,22 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq myCash=0; } break; case 1: { - myCash=0; + myCash=3120; } break; case 2: { - myCash=0; + myCash=11280; } break; case 3: { - myCash=0; + myCash=3550; } break; case 4: { - myCash=10040; + myCash=3020; } break; case 5: { myCash=0; } break; case 6: { - myCash=10960; + myCash=30; } break; default: { } @@ -1202,7 +1202,7 @@ void LocalPlayer::preflopEngine() { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_RAISE; + myAction = PLAYER_ACTION_FOLD; // raise = 3000; } break; @@ -1222,7 +1222,7 @@ void LocalPlayer::preflopEngine() { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_FOLD; + myAction = PLAYER_ACTION_CALL; // raise = 20; // if(mySet >= 40) { // myAction = PLAYER_ACTION_CALL; @@ -1246,7 +1246,7 @@ void LocalPlayer::preflopEngine() { case 3: { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_FOLD; + myAction = PLAYER_ACTION_CALL; // raise = 20; // if(mySet >= 40) { // myAction = PLAYER_ACTION_CALL; @@ -1269,7 +1269,7 @@ void LocalPlayer::preflopEngine() { case 4: { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_FOLD; + myAction = PLAYER_ACTION_CALL; // raise = 20; // if(mySet > 0) { // myAction = PLAYER_ACTION_FOLD; @@ -1588,12 +1588,15 @@ void LocalPlayer::flopEngine() { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_BET; + myAction = PLAYER_ACTION_CHECK; // bet = 10; // raise = 20; // if(mySet >= 40) { // myAction = PLAYER_ACTION_CALL; // } + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { + myAction = PLAYER_ACTION_CALL; + } } break; case 2: { @@ -1613,7 +1616,8 @@ void LocalPlayer::flopEngine() { case 3: { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_CHECK; + myAction = PLAYER_ACTION_BET; + bet = 80; // if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // myAction = PLAYER_ACTION_CALL; // } @@ -1632,6 +1636,31 @@ void LocalPlayer::flopEngine() { } + } + break; + case 4: { + switch(actualHand->getMyID()) { + case 1: { + myAction = PLAYER_ACTION_CHECK; +// bet = 80; + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { + myAction = PLAYER_ACTION_FOLD; + } + } + break; + case 2: { +// myAction = PLAYER_ACTION_RAISE; +// raise = 50; +// if(mySet >= 70) { +// myAction = PLAYER_ACTION_CALL; +// } + } + break; + default: { + } + } + + } break; default: {} @@ -2185,8 +2214,9 @@ void LocalPlayer::turnEngine() { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_RAISE; + myAction = PLAYER_ACTION_BET; // raise = 40; + bet = 120; // if(actualHand->getCurrentBeRo()->getHighestSet() > 100) { // myAction = PLAYER_ACTION_CALL; // } @@ -2209,7 +2239,7 @@ void LocalPlayer::turnEngine() { case 3: { switch(actualHand->getMyID()) { case 1: { -// myAction = PLAYER_ACTION_BET; + myAction = PLAYER_ACTION_FOLD; // bet = 10; // if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // myAction = PLAYER_ACTION_CALL; diff --git a/src/game.cpp b/src/game.cpp index 0b3edede..d11b0344 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -37,7 +37,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr factory, myGameID(gameId), actualSmallBlind(gameData.smallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData) { if(DEBUG_MODE) { - startSmallBlind = 5120; + startSmallBlind = 20; actualSmallBlind = startSmallBlind; } diff --git a/src/gui/qt/mainwindow/log/log.cpp b/src/gui/qt/mainwindow/log/log.cpp index 9fe66739..66723cc2 100644 --- a/src/gui/qt/mainwindow/log/log.cpp +++ b/src/gui/qt/mainwindow/log/log.cpp @@ -1465,7 +1465,7 @@ QString Log::determineHandName(int myCardsValueInt) { it++; } else { different = true; - sameHandCardsValueInt.erase(it); + it = sameHandCardsValueInt.erase(it); } } if(different) { diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 8c64ed02..f89dc61c 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -805,7 +805,7 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) { startData.numberOfPlayers = gameData.maxNumberOfPlayers; Tools::getRandNumber(0, startData.numberOfPlayers-1, 1, &tmpDealerPos, 0); if(DEBUG_MODE) { - tmpDealerPos = 6; + tmpDealerPos = 3; } startData.startDealerPlayerId = static_cast(tmpDealerPos); @@ -2967,7 +2967,7 @@ void mainWindowImpl::localGameModification() { } //Set the playing mode to "manual" - playingMode = 0; + playingMode = 1; }