bugfix: showing ai cards

This commit is contained in:
floty
2007-10-05 12:04:38 +00:00
parent f1761a3793
commit 952e433a18
4 changed files with 198 additions and 69 deletions
+34 -34
View File
@@ -112,11 +112,11 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
case 1: { case 1: {
tempBoardArray[0] = 22; tempBoardArray[0] = 32;
tempBoardArray[1] = 15; tempBoardArray[1] = 24;
tempBoardArray[2] = 24; tempBoardArray[2] = 31;
tempBoardArray[3] = 30; tempBoardArray[3] = 47;
tempBoardArray[4] = 23; tempBoardArray[4] = 19;
myBoard->setMyCards(tempBoardArray); myBoard->setMyCards(tempBoardArray);
@@ -129,15 +129,15 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player0 // player0
it = seatsList->begin(); it = seatsList->begin();
// tempPlayerArray[0] = 51; tempPlayerArray[0] = 12;
// tempPlayerArray[1] = 20; tempPlayerArray[1] = 44;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// (*it)->setMyCards(tempPlayerArray); (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// (*it)->setMyBestHandPosition(temp5Array); (*it)->setMyBestHandPosition(temp5Array);
// player1 // player1
it++; it++;
@@ -155,8 +155,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player2 // player2
it++; it++;
tempPlayerArray[0] = 35; tempPlayerArray[0] = 49;
tempPlayerArray[1] = 18; tempPlayerArray[1] = 34;
tempPlayerAndBoardArray[0] = tempPlayerArray[0]; tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1]; tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -181,15 +181,15 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player4 // player4
it++; it++;
// tempPlayerArray[0] = 25; tempPlayerArray[0] = 45;
// tempPlayerArray[1] = 16; tempPlayerArray[1] = 8;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// (*it)->setMyCards(tempPlayerArray); (*it)->setMyCards(tempPlayerArray);
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// (*it)->setMyBestHandPosition(temp5Array); (*it)->setMyBestHandPosition(temp5Array);
// player5 // player5
it++; it++;
@@ -207,15 +207,15 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player6 // player6
it++; it++;
tempPlayerArray[0] = 13; // tempPlayerArray[0] = 13;
tempPlayerArray[1] = 49; // tempPlayerArray[1] = 49;
tempPlayerAndBoardArray[0] = tempPlayerArray[0]; // tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1]; // tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
(*it)->setMyCards(tempPlayerArray); // (*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); // (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
(*it)->setMyBestHandPosition(temp5Array); // (*it)->setMyBestHandPosition(temp5Array);
} break; } break;
+160 -31
View File
@@ -857,25 +857,25 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
switch(myUniqueID) { switch(myUniqueID) {
case 0: { case 0: {
myCash=0; myCash=3000;
} break; } break;
case 1: { case 1: {
myCash=3120; myCash=3000;
} break; } break;
case 2: { case 2: {
myCash=11280; myCash=3000;
} break; } break;
case 3: { case 3: {
myCash=3550; myCash=3000;
} break; } break;
case 4: { case 4: {
myCash=3020; myCash=3000;
} break; } break;
case 5: { case 5: {
myCash=0; myCash=3000;
} break; } break;
case 6: { case 6: {
myCash=30; myCash=3000;
} break; } break;
default: { default: {
} }
@@ -1202,7 +1202,7 @@ void LocalPlayer::preflopEngine() {
switch(actualHand->getMyID()) { switch(actualHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_CALL;
// raise = 3000; // raise = 3000;
} }
break; break;
@@ -1246,7 +1246,7 @@ void LocalPlayer::preflopEngine() {
case 3: { case 3: {
switch(actualHand->getMyID()) { switch(actualHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_FOLD;
// raise = 20; // raise = 20;
// if(mySet >= 40) { // if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
@@ -1290,15 +1290,15 @@ void LocalPlayer::preflopEngine() {
} }
break; break;
case 5: { case 5: {
if(mySet == 0) { // if(mySet == 0) {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} // }
} }
break; break;
case 6: { case 6: {
if(mySet == 160) { // if(mySet == 160) {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_FOLD;
} // }
} }
break; break;
default: {} default: {}
@@ -1571,7 +1571,7 @@ void LocalPlayer::flopEngine() {
switch(actualHand->getMyID()) { switch(actualHand->getMyID()) {
case 1: { case 1: {
// myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
// } // }
@@ -1594,9 +1594,9 @@ void LocalPlayer::flopEngine() {
// if(mySet >= 40) { // if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
// } // }
if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
} // }
} }
break; break;
case 2: { case 2: {
@@ -1616,8 +1616,8 @@ void LocalPlayer::flopEngine() {
case 3: { case 3: {
switch(actualHand->getMyID()) { switch(actualHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
bet = 80; // bet = 80;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
// } // }
@@ -1643,9 +1643,34 @@ void LocalPlayer::flopEngine() {
case 1: { case 1: {
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
// bet = 80; // bet = 80;
if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
myAction = PLAYER_ACTION_FOLD; // myAction = PLAYER_ACTION_FOLD;
} // }
}
break;
case 2: {
// myAction = PLAYER_ACTION_RAISE;
// raise = 50;
// if(mySet >= 70) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
default: {
}
}
}
break;
case 5: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CHECK;
// bet = 80;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_FOLD;
// }
} }
break; break;
case 2: { case 2: {
@@ -2194,7 +2219,7 @@ void LocalPlayer::turnEngine() {
switch(actualHand->getMyID()) { switch(actualHand->getMyID()) {
case 1: { case 1: {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_FOLD;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 100) { // if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
// myAction = PLAYER_ACTION_FOLD; // myAction = PLAYER_ACTION_FOLD;
// } // }
@@ -2216,7 +2241,7 @@ void LocalPlayer::turnEngine() {
case 1: { case 1: {
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
// raise = 40; // raise = 40;
bet = 120; bet = 40;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 100) { // if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
// } // }
@@ -2239,7 +2264,57 @@ void LocalPlayer::turnEngine() {
case 3: { case 3: {
switch(actualHand->getMyID()) { switch(actualHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_FOLD; // myAction = PLAYER_ACTION_FOLD;
// bet = 10;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
case 2: {
// myAction = PLAYER_ACTION_RAISE;
// raise = 50;
// if(mySet >= 70) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
default: {
}
}
}
break;
case 4: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CALL;
// bet = 10;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
case 2: {
// myAction = PLAYER_ACTION_RAISE;
// raise = 50;
// if(mySet >= 70) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
default: {
}
}
}
break;
case 5: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CALL;
// bet = 10; // bet = 10;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
@@ -2548,11 +2623,12 @@ void LocalPlayer::riverEngine() {
switch(actualHand->getMyID()) { switch(actualHand->getMyID()) {
case 1: { case 1: {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_BET;
bet = 100;
// raise = 40; // raise = 40;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 100) { if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// } }
} }
break; break;
case 2: { case 2: {
@@ -2593,6 +2669,59 @@ void LocalPlayer::riverEngine() {
} }
}
break;
case 4: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_RAISE;
raise = 300;
// bet = 120;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_RAISE;
// raise = 10000;
// }
}
break;
case 2: {
// myAction = PLAYER_ACTION_RAISE;
// raise = 50;
// if(mySet >= 70) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
default: {
}
}
}
break;
case 5: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_FOLD;
// bet = 120;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_RAISE;
// raise = 10000;
// }
}
break;
case 2: {
// myAction = PLAYER_ACTION_RAISE;
// raise = 50;
// if(mySet >= 70) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
default: {
}
}
} }
break; break;
default: {} default: {}
+1 -1
View File
@@ -37,7 +37,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
myGameID(gameId), actualSmallBlind(gameData.smallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData) myGameID(gameId), actualSmallBlind(gameData.smallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
{ {
if(DEBUG_MODE) { if(DEBUG_MODE) {
startSmallBlind = 20; startSmallBlind = 10;
actualSmallBlind = startSmallBlind; actualSmallBlind = startSmallBlind;
} }
+3 -3
View File
@@ -813,7 +813,7 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) {
startData.numberOfPlayers = gameData.maxNumberOfPlayers; startData.numberOfPlayers = gameData.maxNumberOfPlayers;
Tools::getRandNumber(0, startData.numberOfPlayers-1, 1, &tmpDealerPos, 0); Tools::getRandNumber(0, startData.numberOfPlayers-1, 1, &tmpDealerPos, 0);
if(DEBUG_MODE) { if(DEBUG_MODE) {
tmpDealerPos = 3; tmpDealerPos = 1;
} }
startData.startDealerPlayerId = static_cast<unsigned>(tmpDealerPos); startData.startDealerPlayerId = static_cast<unsigned>(tmpDealerPos);
@@ -2566,10 +2566,10 @@ void mainWindowImpl::postRiverRunAnimation2() {
int j; int j;
for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) { for (it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
(*it_c)->getMyCards(tempCardsIntArray); (*it_c)->getMyCards(tempCardsIntArray);
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) { if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
if((*it_c)->getMyAction() || ((*it_c)->getMyAction()==0 && myConfig->readConfigInt("AntiPeekMode")) ) { if((*it_c)->getMyID() || ((*it_c)->getMyID()==0 && myConfig->readConfigInt("AntiPeekMode")) ) {
for(j=0; j<2; j++) { for(j=0; j<2; j++) {
holeCardsArray[(*it_c)->getMyID()][j]->startFlipCards(guiGameSpeed, QPixmap(myAppDataPath +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside); holeCardsArray[(*it_c)->getMyID()][j]->startFlipCards(guiGameSpeed, QPixmap(myAppDataPath +"gfx/cards/default/"+QString::number(tempCardsIntArray[j], 10)+".png"), flipside);