reorgranize debug_mode
This commit is contained in:
+4
-3
@@ -57,9 +57,9 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> 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<EngineFactory> 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<boost::shared_ptr<PlayerInterface> >);
|
||||
@@ -110,6 +110,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
||||
}
|
||||
|
||||
// create player objects
|
||||
if(DEBUG_MODE) myStartCash = myLog->debugMode_getPlayerStartCash(i);
|
||||
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(i, uniqueId, type, myName, myAvatarFile, myStartCash, startQuantityPlayers > i, myStayOnTableStatus, 0);
|
||||
tmpPlayer->setIsSessionActive(true);
|
||||
tmpPlayer->setMyGuid(myGuid);
|
||||
|
||||
@@ -72,10 +72,10 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> 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<EngineFactory> 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<EngineFactory> 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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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<cntActions; action_idx++) {
|
||||
if(mySet > 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user