diff --git a/src/engine/game.cpp b/src/engine/game.cpp index 9f2a6e74..615293b5 100755 --- a/src/engine/game.cpp +++ b/src/engine/game.cpp @@ -57,9 +57,9 @@ Game::Game(GuiInterface* gui, boost::shared_ptr factory, dealerPosition = startData.startDealerPlayerId; if(DEBUG_MODE) { - startSmallBlind = 10; + startSmallBlind = myLog->debugMode_getStartSmallBlind(); currentSmallBlind = startSmallBlind; - dealerPosition = 4; + dealerPosition = myLog->debugMode_getStartDealerPosition(); } int i; @@ -77,7 +77,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr factory, throw LocalException(__FILE__, __LINE__, ERR_DEALER_NOT_FOUND); // create board - currentBoard = myFactory->createBoard(); + currentBoard = myFactory->createBoard(); // create player lists seatsList.reset(new std::list >); @@ -110,6 +110,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr factory, } // create player objects + if(DEBUG_MODE) myStartCash = myLog->debugMode_getPlayerStartCash(i); boost::shared_ptr tmpPlayer = myFactory->createPlayer(i, uniqueId, type, myName, myAvatarFile, myStartCash, startQuantityPlayers > i, myStayOnTableStatus, 0); tmpPlayer->setIsSessionActive(true); tmpPlayer->setMyGuid(myGuid); diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index d9266a46..98c0b60b 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -72,10 +72,10 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, boost: int tempPlayerAndBoardArray[7]; int bestHandPos[5]; int sBluff; - for(i=0; i<5; i++) { - tempBoardArray[i] = cardsArray[i]; - tempPlayerAndBoardArray[i+2] = cardsArray[i]; - } + + for(i=0; i<5; i++) tempBoardArray[i] = cardsArray[i]; + if(DEBUG_MODE) myLog->debugMode_getBoardCards(tempBoardArray,myID); + for(i=0; i<5; i++) tempPlayerAndBoardArray[i+2] = tempBoardArray[i]; k = 0; myBoard->setMyCards(tempBoardArray); @@ -83,10 +83,9 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, boost: (*it)->getMyBestHandPosition(bestHandPos); - for(j=0; j<2; j++) { - tempPlayerArray[j] = cardsArray[2*k+j+5]; - tempPlayerAndBoardArray[j] = cardsArray[2*k+j+5]; - } + for(j=0; j<2; j++) tempPlayerArray[j] = cardsArray[2*k+j+5]; + if(DEBUG_MODE) myLog->debugMode_getPlayerCards(tempPlayerArray,myID,k); + for(j=0; j<2; j++) tempPlayerAndBoardArray[j] = tempPlayerArray[j]; (*it)->setMyCards(tempPlayerArray); (*it)->setMyCardsValueInt(CardsValue::cardsValue(tempPlayerAndBoardArray, bestHandPos)); @@ -108,274 +107,8 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, boost: } } - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEBUGGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // - - if(DEBUG_MODE) { - - //QSqlDatabase *mySqliteLogDb; - - - - // myGui->getMyW()->getSession(); - - //QSqlDatabase * test = myGui->getMyLog()->getMySqliteLogDb(); - -// if(!mySqliteLogDb->open()) { -// MyMessageBox::critical(0, tr("ERROR"),mySqliteLogDb->lastError().text().toUtf8().c_str(), QMessageBox::Cancel); -// } - - - - int temp5Array[5]; - - switch(myID) { - - 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(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); - - (*it)->setMyBestHandPosition(temp5Array); - - // player1 - ++it; - - tempPlayerArray[0] = 31; - tempPlayerArray[1] = 8; - tempPlayerAndBoardArray[0] = tempPlayerArray[0]; - tempPlayerAndBoardArray[1] = tempPlayerArray[1]; - - (*it)->setMyCards(tempPlayerArray); - (*it)->setMyCardsValueInt(CardsValue::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(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); - - (*it)->setMyBestHandPosition(temp5Array); - - // player3 - ++it; - - tempPlayerArray[0] = 31; - tempPlayerArray[1] = 30; - tempPlayerAndBoardArray[0] = tempPlayerArray[0]; - tempPlayerAndBoardArray[1] = tempPlayerArray[1]; - - (*it)->setMyCards(tempPlayerArray); - (*it)->setMyCardsValueInt(CardsValue::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(CardsValue::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(CardsValue::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(CardsValue::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(CardsValue::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(CardsValue::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(); - -// tempPlayerArray[0] = 9; -// tempPlayerArray[1] = 5; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); - - // player1 - ++it; - -// tempPlayerArray[0] = 47; -// tempPlayerArray[1] = 22; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); - - // player2 - ++it; - -// tempPlayerArray[0] = 33; -// tempPlayerArray[1] = 27; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); - - // player3 - ++it; - -// tempPlayerArray[0] = 38; -// tempPlayerArray[1] = 22; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); - - // player4 - ++it; - -// tempPlayerArray[0] = 25; -// tempPlayerArray[1] = 16; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); - - // player5 - ++it; - -// tempPlayerArray[0] = 27; -// tempPlayerArray[1] = 10; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(CardsValue::cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); - - } - break; - default: - {} - - } - - - - } -// ---------------------------------------- - - // determine dealer, SB, BB - + // determine dealer, small blind, big blind assignButtons(); - setBlinds(); if(myLog) myLog->logNewHandMsg(myID, dealerPosition+1, smallBlind, smallBlindPosition+1, 2*smallBlind, bigBlindPosition+1, seatsList); diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index c3d16b25..fbf75fe8 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -865,62 +865,6 @@ LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType ty sBluff(0), sBluffStatus(false), m_actionTimeoutCounter(0), m_isSessionActive(false), m_isKicked(false), m_isMuted(false) { - // !!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!! - if(DEBUG_MODE) { - - //cout << myConfig->readConfigString("LogDir").c_str() << endl; - - switch(myUniqueID) { - - case 0: { - myCash=4140; - } - break; - case 1: { - myCash=4940; - } - break; - case 2: { - myCash=4660; - } - break; - case 3: { - myCash=4960; - } - break; - case 4: { - myCash=5680; - } - break; - case 5: { - myCash=4960; - } - break; - case 6: { - myCash=4960; - } - break; - case 7: { - myCash=5780; - } - break; - case 8: { - myCash=4960; - } - break; - case 9: { - myCash=4960; - } - break; - - default: { - } - - } - - } - //////////////////////////// - int i; for(i=0; i<3; i++) { myNiveau[i] = 0; @@ -959,50 +903,6 @@ LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType ty } myDude4 = (myDude4/count)-interval; - // !!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!! - if(DEBUG_MODE) { - - switch(myUniqueID) { - - case 0: { - // myDude4=0; - } break; - case 1: { - // myDude4=-20; - } break; - case 2: { - // myDude4=0; - } break; - case 3: { - // myDude4=0; - } break; - case 4: { - // myDude4=0; - } break; - case 5: { - // myDude4=0; - } break; - case 6: { - // myDude4=0; - } break; - case 7: { - // myDude4=0; - } break; - case 8: { - // myDude4=0; - } break; - case 9: { - // myDude4=0; - } break; - - default: { - } - - } - - } - //////////////////////////// - } @@ -1363,144 +1263,7 @@ void LocalPlayer::preflopEngine() // cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl; - if(DEBUG_MODE) { - switch(myUniqueID) { - case 0: - {} - break; - case 1: { - // player 1 - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; - // raise = 20; - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 25; - } - break; - default: { - } - } - - } - break; - case 2: { - // player 2 - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; -// raise = 20000; - // if(mySet >= 40) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - case 2: { - // myAction = PLAYER_ACTION_FOLD; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - } - break; - case 3: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; -// raise = 2000; - // if(mySet >= 40) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - case 2: { - // myAction = PLAYER_ACTION_FOLD; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - } - break; - case 4: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; -// raise = 2000; - // if(mySet > 0) { - // myAction = PLAYER_ACTION_FOLD; - // } - } - break; - case 2: { - // myAction = PLAYER_ACTION_FOLD; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - } - break; - case 5: { - // if(mySet == 0) { - myAction = PLAYER_ACTION_CALL; -// raise = 20; - // } - } - break; - case 6: { - // if(mySet == 160) { - myAction = PLAYER_ACTION_CHECK; - // } - } - break; - case 7: { - // if(mySet == 160) { - myAction = PLAYER_ACTION_CALL; - - // } - } - break; - case 8: { - // if(mySet == 160) { - myAction = PLAYER_ACTION_CALL; - - // } - } - break; - case 9: { - // if(mySet == 160) { - myAction = PLAYER_ACTION_CALL; - - // } - } - break; - default: - {} - } - - - } - + if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_PREFLOP, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); evaluation(bet, raise); } @@ -1761,436 +1524,10 @@ void LocalPlayer::flopEngine() } - - if(DEBUG_MODE) { - switch(myUniqueID) { - case 0: { - } break; - case 1: { - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CHECK; - // bet = 20; - // if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - case 2: { - // myAction = PLAYER_ACTION_BET; - // raise = 25; - } break; - default: { - } - } - } break; - case 2: { - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CHECK; - // bet = 20; - // raise = 20; - // if(mySet > 20) { - // myAction = PLAYER_ACTION_CALL; - // } - // if(currentHand->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 3: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CHECK; - // raise = 400; - // if(currentHand->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(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CHECK; - // raise = 140; -// if(currentHand->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(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CHECK; -// bet = 20; - // if(currentHand->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; - case 6: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CHECK; -// raise = 40; -// if(currentHand->getCurrentBeRo()->getHighestSet() > 60) { -// myAction = PLAYER_ACTION_CALL; -// } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 7: { - myAction = PLAYER_ACTION_CHECK; - } - break; - case 8: { - myAction = PLAYER_ACTION_CHECK; - } - break; - case 9: { - myAction = PLAYER_ACTION_CHECK; - } - break; - default: - {} - } - - - } - - // minimum raise setting and resetting - // if(myAction == 5) { - // - // if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) { - // raise = currentHand->getCurrentBeRo()->getMinimumRaise(); - // } - // currentHand->getCurrentBeRo()->setMinimumRaise(raise); - // - // } - // - // if(myAction == 4) { currentHand->getCurrentBeRo()->setMinimumRaise(bet); } + if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_FLOP, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); evaluation(bet, raise); - - - - // cout << "Engine 0.4" << endl; - // int tempArray[5]; - // int boardCards[5]; - // int info[4]; - // int cBluff; - // int sBluff; - // int bet = 0; - // int raise = 0; - // - // int i; - // - // - // for(i=0; i<2; i++) tempArray[i] = myCards[i]; - // currentBoard->getMyCards(boardCards); - // for(i=0; i<3; i++) tempArray[2+i] = boardCards[i]; - // - // for(i=0; i<4; i++) info[i] = -1; - // - // // for(i=0; i<5; i++) cout << tempArray[i] << " "; - // // cout << endl; - // - // cout << myID << ": "; - // - // flopCardsValue(tempArray); - // - // // aktive Situation --> check / bet - // if(currentHand->getCurrentBeRo()->getHighestSet() == 0) { - // - // switch(info[0]) { - // case 9: {} - // case 8: {} - // case 7: {} - // case 6: {} - // case 5: {} - // case 4: { - // Tools::getRandNumber(0,100,1,&cBluff,0); - // if(cBluff < 35) { - // myAction = PLAYER_ACTION_CHECK; - // } - // else { - // if(myCash/(2*currentHand->getSmallBlind()) <= 8) { - // myAction = PLAYER_ACTION_ALLIN; - // } else { - // if(cBluff < 60) { - // bet = (7-myDude4)*2*currentHand->getSmallBlind(); - // } else { - // bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind(); - // } - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // } - // } - // break; - // case 3: { - // switch(info[3]) { - // case 2: { - // Tools::getRandNumber(0,100,1,&cBluff,0); - // if(cBluff < 35) { - // myAction = PLAYER_ACTION_CHECK; - // } - // else { - // if(myCash/(2*currentHand->getSmallBlind()) <= 8) { - // myAction = PLAYER_ACTION_ALLIN; - // } else { - // if(cBluff < 60) { - // bet = (5-myDude4)*2*currentHand->getSmallBlind(); - // } else { - // bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind(); - // } - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // } - // } - // break; - // case 1: { - // Tools::getRandNumber(0,100,1,&cBluff,0); - // if(cBluff < 40) { - // myAction = PLAYER_ACTION_CHECK; - // } - // else { - // if(myCash/(2*currentHand->getSmallBlind()) <= 6) { - // myAction = PLAYER_ACTION_ALLIN; - // } else { - // if(cBluff < 60) { - // bet = (3-myDude4)*2*currentHand->getSmallBlind(); - // } else { - // bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind(); - // } - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // } - // } - // break; - // default: { - // Tools::getRandNumber(0,100,1,&sBluff,0); - // if(info[1] >= 10 && sBluff <= 40) { - // bet = (sBluff/10)*2*currentHand->getSmallBlind(); - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // else { - // myAction = PLAYER_ACTION_CHECK; - // } - // } - // } - // } - // break; - // case 2: { - // switch(info[3]) { - // case 2: { - // Tools::getRandNumber(0,100,1,&cBluff,0); - // if(cBluff > 80) { - // myAction = PLAYER_ACTION_CHECK; - // } - // else { - // if(myCash/(2*currentHand->getSmallBlind()) <= 6) { - // myAction = PLAYER_ACTION_ALLIN; - // } else { - // bet = (cBluff/20)*2*currentHand->getSmallBlind(); - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // } - // } - // break; - // default: { - // Tools::getRandNumber(0,100,1,&cBluff,0); - // if(cBluff > 90) { - // myAction = PLAYER_ACTION_CHECK; - // } - // else { - // if(myCash/(2*currentHand->getSmallBlind()) <= 5) { - // myAction = PLAYER_ACTION_ALLIN; - // } else { - // bet = (cBluff/30)*2*currentHand->getSmallBlind(); - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // } - // } - // } - // } - // break; - // case 1: { - // if(!info[2]) { - // Tools::getRandNumber(0,100,1,&sBluff,0); - // switch(info[3]) { - // case 2: {} - // case 1: { - // if(currentHand->getActivePlayerList().size() == 2) { - // bet = (1-myDude4)*2*currentHand->getSmallBlind(); - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // - // } - // else { - // switch(info[1]) { - // case 3: { - // if(sBluff <= 10) { - // bet = (sBluff/5 + 2)*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // else { - // myAction = PLAYER_ACTION_CHECK; - // } - // } - // break; - // case 2: { - // if(sBluff <= 15) { - // bet = (sBluff/5 + 2)*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // else { - // myAction = PLAYER_ACTION_CHECK; - // } - // } - // break; - // case 1: { - // if(sBluff <= 50) { - // bet = (sBluff/15 + 2)*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // else { - // myAction = PLAYER_ACTION_CHECK; - // } - // } - // break; - // default: { - // if(myCash/(2*currentHand->getSmallBlind()) <= 5) { - // myAction = PLAYER_ACTION_ALLIN; - // } else { - // bet = (sBluff/15)*2*currentHand->getSmallBlind(); - // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); - // myAction = PLAYER_ACTION_BET; - // } - // } - // break; - // } - // } - // } - // break; - // default: { - // } - // } - // } - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // } - // break; - // default: {} - // } - // - // - // - // } - // // passive Situation --> fold / call / raise - // else { - // - // - // - // } - - } @@ -2461,259 +1798,7 @@ void LocalPlayer::turnEngine() } - - if(DEBUG_MODE) { - - switch(myUniqueID) { - - case 0: { - } - break; - case 1: { - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_FOLD; - // bet = 20; - // if(currentHand->getCurrentBeRo()->getHighestSet() > 20) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - case 2: { - // myAction = PLAYER_ACTION_BET; - // raise = 25; - } - break; - default: { - } - } - } - break; - case 2: { - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_FOLD; - // raise = 40; - // bet = 40; - // if(currentHand->getCurrentBeRo()->getHighestSet() > 100) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - } - break; - case 3: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_FOLD; - // bet = 10; - // if(currentHand->getCurrentBeRo()->getHighestSet() > 500) { - // 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 4: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_FOLD; -// bet = 120; -// if(currentHand->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(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_BET; - bet = 20; - if(currentHand->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 6: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_RAISE; - bet = 20; - if(currentHand->getCurrentBeRo()->getHighestSet() > 20) { - myAction = PLAYER_ACTION_CALL; -// raise = 10000; - } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 7: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; -// bet = 20; -// if(currentHand->getCurrentBeRo()->getHighestSet() > 20) { -// myAction = PLAYER_ACTION_CALL; -// raise = 10000; -// } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 8: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_FOLD; -// bet = 20; -// if(currentHand->getCurrentBeRo()->getHighestSet() > 20) { -// myAction = PLAYER_ACTION_CALL; -// raise = 10000; -// } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 9: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_RAISE; - bet = 60; - if(currentHand->getCurrentBeRo()->getHighestSet() > 40) { - myAction = PLAYER_ACTION_CALL; -// raise = 10000; - } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - default: - {} - } - - - } - - // minimum raise setting and resetting - // if(myAction == 5) { - // - // if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) { - // raise = currentHand->getCurrentBeRo()->getMinimumRaise(); - // } - // currentHand->getCurrentBeRo()->setMinimumRaise(raise); - // - // } - // - // if(myAction == 4) { currentHand->getCurrentBeRo()->setMinimumRaise(bet); } + if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_TURN, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); evaluation(bet, raise); @@ -2973,251 +2058,10 @@ void LocalPlayer::riverEngine() } - - if(DEBUG_MODE) { - switch(myUniqueID) { - case 0: { - } break; - case 1: { - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; - // raise = 40; - // if(currentHand->getCurrentBeRo()->getHighestSet() > 60) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - case 2: { - // myAction = PLAYER_ACTION_BET; - // raise = 25; - } break; - default: { - } - } - } break; - case 2: { - - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_BET; - bet = 100; - // raise = 40; - if(currentHand->getCurrentBeRo()->getHighestSet() > 100) { - myAction = PLAYER_ACTION_CALL; - } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - } - break; - case 3: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; - // bet = 120; - // if(currentHand->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 4: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_BET; - // raise = 300; - bet = 220; - if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { - myAction = PLAYER_ACTION_CALL; - // raise = 10000; - } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 5: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CHECK; - // bet = 120; - if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { - myAction = PLAYER_ACTION_FOLD; -// raise = 10000; - } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 6: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_BET; - bet = 40; - if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { - myAction = PLAYER_ACTION_CALL; -// raise = 10000; - } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 7: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_CALL; -// bet = 40; -// if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { -// myAction = PLAYER_ACTION_CALL; -// raise = 10000; -// } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 8: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_BET; - bet = 40; - if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { - myAction = PLAYER_ACTION_CALL; -// raise = 10000; - } - } - break; - case 2: { - // myAction = PLAYER_ACTION_RAISE; - // raise = 50; - // if(mySet >= 70) { - // myAction = PLAYER_ACTION_CALL; - // } - } - break; - default: { - } - } - - - } - break; - case 9: { - switch(currentHand->getMyID()) { - case 1: { - myAction = PLAYER_ACTION_RAISE; - bet = 180; - if(currentHand->getCurrentBeRo()->getHighestSet() > 40) { - 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; - default: - {} - } - - - } + if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_RIVER, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); evaluation(bet, raise); - - - } diff --git a/src/engine/log.cpp b/src/engine/log.cpp index 1f50fde2..932c49f9 100644 --- a/src/engine/log.cpp +++ b/src/engine/log.cpp @@ -688,3 +688,129 @@ Log::exec_transaction() // mySqliteLogDb = NULL; // } //} + +unsigned +Log::debugMode_getStartSmallBlind() +{ + return 10; +} + +unsigned +Log::debugMode_getStartDealerPosition() +{ + return 4; +} + +void +Log::debugMode_getBoardCards(int *tempBoardArray, int handID) +{ + unsigned boardCards[][5] = { + { 4, 19, 20, 43, 49 }, + { 4, 19, 20, 43, 49 } + }; + + if((unsigned)handID <= sizeof(boardCards)/sizeof(int)/5) { + for(int i=0; i<5; i++) tempBoardArray[i] = boardCards[handID-1][i]; + } +} + +void +Log::debugMode_getPlayerCards(int *tempPlayerArray, int handID, int seatID) +{ + int playerCards[][10][2] = { + { {18,17}, {-1,-1}, {26,27}, {31,30}, {50,51}, {25,24}, {38,37}, {32,33}, {19,20}, {18,17} }, + { {18,17}, {31, 8}, {26,27}, {31,30}, {50,51}, {25,24}, {38,37}, {32,33}, {19,20}, {18,17} } + }; + + if((unsigned)handID <= sizeof(playerCards)/sizeof(int)/10/2) { + for(int i=0; i<2; i++) { + if(playerCards[handID-1][seatID][i]>=0) tempPlayerArray[i] = playerCards[handID-1][seatID][i]; + } + } +} + +unsigned +Log::debugMode_getPlayerStartCash(int seatID) +{ + unsigned startCashVector[] = { 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000 }; + return startCashVector[seatID]; +} + +void +Log::debugMode_getPlayerAction(GameState gameState, int handID, int seatID, PlayerAction *playerAction, int *bet, int *raise, int mySet) +{ + const unsigned cntBeRo = 4; + const unsigned cntPlayer = 10; + const unsigned cntActions = 4; + const unsigned cntValues = 3; + + int playerActionMatrix[][cntBeRo][cntPlayer][cntActions][cntValues] = { + { /* handID==0 */ + { /* preflop */ + { {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player0 */ + { {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player1 */ + { {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player2 */ + { {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player3 */ + { {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player4 */ + { {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player5 */ + { {-1,PLAYER_ACTION_RAISE,100},{50,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player6 */ + { {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player7 */ + { {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player8 */ + { {-1,PLAYER_ACTION_CALL ,-1},{10,PLAYER_ACTION_RAISE ,100},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} } /* player9 */ + }, + { /* flop */ + { {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} } + }, + { /* turn */ + { {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} } + }, + { /* river */ + { {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, + { {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} } + } + } + }; + + if((unsigned)handID <= sizeof(playerActionMatrix)/sizeof(int)/cntBeRo/cntPlayer/cntActions/cntValues) { + int max_thd = 0; + unsigned next_action_idx = 0; + for(unsigned action_idx=0; action_idx playerActionMatrix[handID-1][gameState][seatID][action_idx][0] && playerActionMatrix[handID-1][gameState][seatID][action_idx][0] > max_thd) { + max_thd = playerActionMatrix[handID-1][gameState][seatID][action_idx][0]; + next_action_idx = action_idx; + } + *playerAction = (PlayerAction)playerActionMatrix[handID-1][gameState][seatID][next_action_idx][1]; + if(*playerAction == PLAYER_ACTION_BET) { + *bet = playerActionMatrix[handID-1][gameState][seatID][next_action_idx][2]; + } else if(*playerAction == PLAYER_ACTION_RAISE || *playerAction == PLAYER_ACTION_ALLIN) { + *raise = playerActionMatrix[handID-1][gameState][seatID][next_action_idx][2]; + } + } + } +} diff --git a/src/engine/log.h b/src/engine/log.h index 43c0f864..a26df47e 100644 --- a/src/engine/log.h +++ b/src/engine/log.h @@ -66,6 +66,13 @@ public: void logAfterGame(); // void closeLogDbAtExit(); + unsigned debugMode_getStartSmallBlind(); + unsigned debugMode_getStartDealerPosition(); + void debugMode_getBoardCards(int *tempBoardArray, int handID); + void debugMode_getPlayerCards(int *tempPlayerArray, int handID, int seatID); + unsigned debugMode_getPlayerStartCash(int seatID); + void debugMode_getPlayerAction(GameState gameState, int handID, int seatID, PlayerAction* playerAction, int* bet, int* raise, int mySet); + void setCurrentRound(GameState theValue) { currentRound = theValue; } diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 3d31711f..bbf558e4 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -113,12 +113,12 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) tabsDiag = new QDialog(this); tabs.setupUi(tabsDiag); textLabel_handLabel->hide(); - #ifdef ANDROID - tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - this->setWindowState(Qt::WindowFullScreen); - #else - tabs.pushButton_settings->hide(); - #endif +#ifdef ANDROID + tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + this->setWindowState(Qt::WindowFullScreen); +#else + tabs.pushButton_settings->hide(); +#endif tabs.label_chance->setMyStyle(myGameTableStyle); #else label_chance->setMyStyle(myGameTableStyle); @@ -1443,7 +1443,7 @@ void gameTableImpl::dealHoleCards() (*it_c)->getMyCards(tempCardsIntArray); for(j=0; j<2; j++) { if((*it_c)->getMyActiveStatus()) { - if (( (*it_c)->getMyID() == 0)/* || DEBUG_MODE*/) { + if (( (*it_c)->getMyID() == 0) || DEBUG_MODE) { tempCardsPixmapArray[j].load(myCardDeckStyle->getCurrentDir()+QString::number(tempCardsIntArray[j], 10)+".png"); if(myConfig->readConfigInt("AntiPeekMode")) { holeCardsArray[(*it_c)->getMyID()][j]->setPixmap(flipside, true); diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 4d7b3c78..e8565d28 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -383,9 +383,6 @@ void startWindowImpl::startNewLocalGame(newGameDialogImpl *v) int tmpDealerPos = 0; startData.numberOfPlayers = gameData.maxNumberOfPlayers; Tools::GetRand(0, startData.numberOfPlayers-1, 1, &tmpDealerPos); - //if(DEBUG_MODE) { - // tmpDealerPos = 4; - //} startData.startDealerPlayerId = static_cast(tmpDealerPos); //some gui modifications