adds activePlayerList and runningPlayerList (XXI) - bugfixes

This commit is contained in:
doitux
2007-09-28 15:04:52 +00:00
parent 45d71f0866
commit eec7e6c097
3 changed files with 98 additions and 72 deletions
+77 -57
View File
@@ -112,11 +112,11 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
case 1: {
tempBoardArray[0] = 40;
tempBoardArray[1] = 21;
tempBoardArray[0] = 27;
tempBoardArray[1] = 37;
tempBoardArray[2] = 45;
tempBoardArray[3] = 43;
tempBoardArray[4] = 50;
tempBoardArray[3] = 51;
tempBoardArray[4] = 23;
myBoard->setMyCards(tempBoardArray);
@@ -129,21 +129,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player0
it = seatsList->begin();
tempPlayerArray[0] = 51;
tempPlayerArray[1] = 20;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player1
it++;
// tempPlayerArray[0] = 24;
// tempPlayerArray[1] = 19;
// tempPlayerArray[0] = 51;
// tempPlayerArray[1] = 20;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
@@ -151,6 +138,19 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// (*it)->setMyBestHandPosition(temp5Array);
// player1
it++;
tempPlayerArray[0] = 12;
tempPlayerArray[1] = 48;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player2
it++;
@@ -168,21 +168,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player3
it++;
tempPlayerArray[0] = 12;
tempPlayerArray[1] = 46;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
(*it)->setMyBestHandPosition(temp5Array);
// player4
it++;
// tempPlayerArray[0] = 25;
// tempPlayerArray[1] = 16;
// tempPlayerArray[0] = 12;
// tempPlayerArray[1] = 46;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
@@ -191,11 +178,37 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
//
// (*it)->setMyBestHandPosition(temp5Array);
// 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++;
tempPlayerArray[0] = 43;
tempPlayerArray[1] = 30;
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[0] = 48;
tempBoardArray[1] = 21;
tempBoardArray[2] = 4;
tempBoardArray[3] = 9;
@@ -207,7 +220,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> 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();
@@ -225,15 +238,15 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// 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);
// 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++;
@@ -277,15 +290,15 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// 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);
// 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: {}
@@ -555,11 +568,18 @@ void LocalHand::switchRounds() {
// exception
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount is nonfold too -> preflop is over
// 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[actualRound]->getSmallBlindPositionId());
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[actualRound]->getBigBlindPositionId());
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && actualRound == GAME_STATE_PREFLOP && myBeRo[actualRound]->getFirstRound() && nonFoldPlayerCounter == 2) {
if( (*bigBlindIt_c)->getMySet() <= smallBlind ) {
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && actualRound == GAME_STATE_PREFLOP && myBeRo[actualRound]->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;
}
}
+16 -15
View File
@@ -860,22 +860,22 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
myCash=0;
} break;
case 1: {
myCash=104;
myCash=2520;
} break;
case 2: {
myCash=80;
} break;
case 3: {
myCash=1280;
} break;
case 4: {
myCash=0;
} break;
case 3: {
myCash=0;
} break;
case 4: {
myCash=14700;
} break;
case 5: {
myCash=336;
myCash=3780;
} break;
case 6: {
// myCash=14800;
myCash=0;
} break;
default: {
}
@@ -1202,7 +1202,8 @@ void LocalPlayer::preflopEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_RAISE;
raise = 3000;
}
break;
case 2: {
@@ -1221,7 +1222,7 @@ void LocalPlayer::preflopEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_FOLD;
// myAction = PLAYER_ACTION_FOLD;
// raise = 20;
// if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL;
@@ -1229,7 +1230,7 @@ void LocalPlayer::preflopEngine() {
}
break;
case 2: {
myAction = PLAYER_ACTION_FOLD;
// myAction = PLAYER_ACTION_FOLD;
// raise = 50;
// if(mySet >= 70) {
// myAction = PLAYER_ACTION_CALL;
@@ -1245,7 +1246,7 @@ void LocalPlayer::preflopEngine() {
case 3: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_FOLD;
// myAction = PLAYER_ACTION_FOLD;
// raise = 20;
// if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL;
@@ -1253,7 +1254,7 @@ void LocalPlayer::preflopEngine() {
}
break;
case 2: {
myAction = PLAYER_ACTION_FOLD;
// myAction = PLAYER_ACTION_FOLD;
// raise = 50;
// if(mySet >= 70) {
// myAction = PLAYER_ACTION_CALL;
@@ -1268,7 +1269,7 @@ void LocalPlayer::preflopEngine() {
case 4: {
switch(actualHand->getMyID()) {
case 1: {
// myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_FOLD;
// raise = 20;
// if(mySet > 0) {
// myAction = PLAYER_ACTION_FOLD;
+5
View File
@@ -36,6 +36,11 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
startHandsBeforeRaiseSmallBlind(gameData.handsBeforeRaise),
myGameID(gameId), actualSmallBlind(gameData.smallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
{
if(DEBUG_MODE) {
startSmallBlind = 5120;
actualSmallBlind = startSmallBlind;
}
// cout << "Create Game Object" << "\n";
int i;