full bet rule (part 4)

This commit is contained in:
floty
2010-01-19 20:33:15 +00:00
parent 0191118138
commit 8017d1c8cb
3 changed files with 91 additions and 94 deletions
+10 -10
View File
@@ -104,11 +104,11 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
case 1: { case 1: {
tempBoardArray[0] = 21; tempBoardArray[0] = 36;
tempBoardArray[1] = 8; tempBoardArray[1] = 21;
tempBoardArray[2] = 50; tempBoardArray[2] = 50;
tempBoardArray[3] = 11; tempBoardArray[3] = 15;
tempBoardArray[4] = 16; tempBoardArray[4] = 12;
myBoard->setMyCards(tempBoardArray); myBoard->setMyCards(tempBoardArray);
@@ -121,8 +121,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player0 // player0
it = seatsList->begin(); it = seatsList->begin();
tempPlayerArray[0] = 30; tempPlayerArray[0] = 13;
tempPlayerArray[1] = 37; tempPlayerArray[1] = 22;
tempPlayerAndBoardArray[0] = tempPlayerArray[0]; tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1]; tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -134,8 +134,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player1 // player1
it++; it++;
tempPlayerArray[0] = 38; tempPlayerArray[0] = 47;
tempPlayerArray[1] = 25; tempPlayerArray[1] = 51;
tempPlayerAndBoardArray[0] = tempPlayerArray[0]; tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1]; tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -173,8 +173,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player4 // player4
it++; it++;
tempPlayerArray[0] = 45; tempPlayerArray[0] = 48;
tempPlayerArray[1] = 8; tempPlayerArray[1] = 7;
tempPlayerAndBoardArray[0] = tempPlayerArray[0]; tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1]; tempPlayerAndBoardArray[1] = tempPlayerArray[1];
+80 -83
View File
@@ -859,19 +859,19 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
switch(myUniqueID) { switch(myUniqueID) {
case 0: { case 0: {
myCash=50; myCash=19855;
} break; } break;
case 1: { case 1: {
myCash=1000; myCash=20750;
} break; } break;
case 2: { case 2: {
myCash=1000; myCash=0;
} break; } break;
case 3: { case 3: {
myCash=0; myCash=0;
} break; } break;
case 4: { case 4: {
myCash=0; myCash=9395;
} break; } break;
case 5: { case 5: {
myCash=0; myCash=0;
@@ -937,7 +937,7 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
// myDude4=0; // myDude4=0;
} break; } break;
case 1: { case 1: {
myDude4=-20; // myDude4=-20;
} break; } break;
case 2: { case 2: {
// myDude4=0; // myDude4=0;
@@ -1037,6 +1037,8 @@ void LocalPlayer::action() {
default: {} default: {}
} }
// cout << currentHand->getCurrentBeRo()->getMinimumRaise() << endl;
// cout << checkMyAction(myAction, mySet - myOldSet, myOldSet, myOldCash, oldHighestSet, oldMinimumRaise, currentHand->getSmallBlind()) << endl; // cout << checkMyAction(myAction, mySet - myOldSet, myOldSet, myOldCash, oldHighestSet, oldMinimumRaise, currentHand->getSmallBlind()) << endl;
@@ -1312,14 +1314,14 @@ void LocalPlayer::preflopEngine() {
} }
// minimum raise setting and resetting // minimum raise setting and resetting
if(myAction == 5) { // if(myAction == 5) {
//
if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) { // if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) {
raise = currentHand->getCurrentBeRo()->getMinimumRaise(); // raise = currentHand->getCurrentBeRo()->getMinimumRaise();
} // }
currentHand->getCurrentBeRo()->setMinimumRaise(raise); // currentHand->getCurrentBeRo()->setMinimumRaise(raise);
} // }
//
// cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl; // cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl;
@@ -1332,8 +1334,8 @@ void LocalPlayer::preflopEngine() {
switch(currentHand->getMyID()) { switch(currentHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_CHECK;
raise = 20; // raise = 20;
} }
break; break;
case 2: { case 2: {
@@ -1700,18 +1702,6 @@ void LocalPlayer::flopEngine() {
} }
// 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) { if(DEBUG_MODE) {
switch(myUniqueID) { switch(myUniqueID) {
@@ -1722,10 +1712,10 @@ void LocalPlayer::flopEngine() {
switch(currentHand->getMyID()) { switch(currentHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
bet = 640; bet = 20;
// if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { if(currentHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// } }
} break; } break;
case 2: { case 2: {
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
@@ -1739,12 +1729,12 @@ void LocalPlayer::flopEngine() {
switch(currentHand->getMyID()) { switch(currentHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_BET;
// bet = 10; bet = 20;
// raise = 20; // raise = 20;
// if(mySet >= 40) { if(mySet > 20) {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// } }
// if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { // if(currentHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
// } // }
@@ -1792,11 +1782,11 @@ void LocalPlayer::flopEngine() {
case 4: { case 4: {
switch(currentHand->getMyID()) { switch(currentHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_RAISE;
bet = 40; raise = 140;
if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { // if(currentHand->getCurrentBeRo()->getHighestSet() > 0) {
myAction = PLAYER_ACTION_FOLD; // myAction = PLAYER_ACTION_FOLD;
} // }
} }
break; break;
case 2: { case 2: {
@@ -1870,6 +1860,18 @@ void LocalPlayer::flopEngine() {
} }
// 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); }
evaluation(bet, raise); evaluation(bet, raise);
@@ -2388,18 +2390,6 @@ void LocalPlayer::turnEngine() {
} }
// 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) { if(DEBUG_MODE) {
@@ -2412,11 +2402,11 @@ void LocalPlayer::turnEngine() {
switch(currentHand->getMyID()) { switch(currentHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_BET;
raise = 40; bet = 20;
// if(currentHand->getCurrentBeRo()->getHighestSet() > 100) { if(currentHand->getCurrentBeRo()->getHighestSet() > 20) {
// myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_CALL;
// } }
} }
break; break;
case 2: { case 2: {
@@ -2484,8 +2474,8 @@ void LocalPlayer::turnEngine() {
case 4: { case 4: {
switch(currentHand->getMyID()) { switch(currentHand->getMyID()) {
case 1: { case 1: {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_RAISE;
// bet = 10; raise = 120;
// if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { // if(currentHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL; // myAction = PLAYER_ACTION_CALL;
// } // }
@@ -2563,6 +2553,18 @@ void LocalPlayer::turnEngine() {
} }
// 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); }
evaluation(bet, raise); evaluation(bet, raise);
} }
@@ -2824,18 +2826,6 @@ void LocalPlayer::riverEngine() {
} }
// 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) { if(DEBUG_MODE) {
switch(myUniqueID) { switch(myUniqueID) {
@@ -2845,10 +2835,11 @@ void LocalPlayer::riverEngine() {
switch(currentHand->getMyID()) { switch(currentHand->getMyID()) {
case 1: { case 1: {
// myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_RAISE;
// if(currentHand->getCurrentBeRo()->getHighestSet() > 100) { raise = 40;
// myAction = PLAYER_ACTION_FOLD; if(currentHand->getCurrentBeRo()->getHighestSet() > 60) {
// } myAction = PLAYER_ACTION_CALL;
}
} break; } break;
case 2: { case 2: {
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
@@ -2916,10 +2907,10 @@ void LocalPlayer::riverEngine() {
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
raise = 300; raise = 300;
// bet = 120; // bet = 120;
// if(currentHand->getCurrentBeRo()->getHighestSet() > 0) { if(currentHand->getCurrentBeRo()->getHighestSet() > 360) {
// myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
// raise = 10000; raise = 10000;
// } }
} }
break; break;
case 2: { case 2: {
@@ -3005,6 +2996,7 @@ void LocalPlayer::riverEngine() {
void LocalPlayer::evaluation(int bet, int raise) { void LocalPlayer::evaluation(int bet, int raise) {
int highestSet = 0; int highestSet = 0;
highestSet = currentHand->getCurrentBeRo()->getHighestSet(); highestSet = currentHand->getCurrentBeRo()->getHighestSet();
@@ -3046,6 +3038,7 @@ void LocalPlayer::evaluation(int bet, int raise) {
if(myCash < 2*currentHand->getSmallBlind()) { if(myCash < 2*currentHand->getSmallBlind()) {
currentHand->getCurrentBeRo()->setFullBetRule(true); currentHand->getCurrentBeRo()->setFullBetRule(true);
} }
currentHand->getCurrentBeRo()->setMinimumRaise(myCash);
mySet = myCash; mySet = myCash;
myCash = 0; myCash = 0;
myAction = 6; myAction = 6;
@@ -3053,6 +3046,7 @@ void LocalPlayer::evaluation(int bet, int raise) {
} }
// sonst // sonst
else { else {
currentHand->getCurrentBeRo()->setMinimumRaise(bet);
myCash = myCash - bet; myCash = myCash - bet;
mySet = bet; mySet = bet;
highestSet = mySet; highestSet = mySet;
@@ -3061,9 +3055,7 @@ void LocalPlayer::evaluation(int bet, int raise) {
break; break;
// raise // raise
case 5: { case 5: {
// cout << "evaluation(raise) - highestSet = " << highestSet << " - raise: " << raise << endl; if(currentHand->getCurrentBeRo()->getFullBetRule()) { // full bet rule -> only call possible
// full bet rule -> only call possible
if(currentHand->getCurrentBeRo()->getFullBetRule()) {
// all in // all in
if(highestSet >= myCash + mySet) { if(highestSet >= myCash + mySet) {
mySet += myCash; mySet += myCash;
@@ -3078,6 +3070,9 @@ void LocalPlayer::evaluation(int bet, int raise) {
} }
} }
else { else {
if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) {
raise = currentHand->getCurrentBeRo()->getMinimumRaise();
}
// all in // all in
if(highestSet + raise >= myCash + mySet) { if(highestSet + raise >= myCash + mySet) {
// -> full bet rule // -> full bet rule
@@ -3085,12 +3080,14 @@ void LocalPlayer::evaluation(int bet, int raise) {
currentHand->getCurrentBeRo()->setFullBetRule(true); currentHand->getCurrentBeRo()->setFullBetRule(true);
} }
mySet += myCash; mySet += myCash;
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
myCash = 0; myCash = 0;
myAction = 6; myAction = 6;
if(mySet > highestSet) highestSet = mySet; if(mySet > highestSet) highestSet = mySet;
} }
// sonst // sonst
else { else {
currentHand->getCurrentBeRo()->setMinimumRaise(raise);
myCash = myCash + mySet - highestSet - raise; myCash = myCash + mySet - highestSet - raise;
mySet = highestSet + raise; mySet = highestSet + raise;
highestSet = mySet; highestSet = mySet;
+1 -1
View File
@@ -271,7 +271,7 @@ void startWindowImpl::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 = 2; tmpDealerPos = 4;
} }
startData.startDealerPlayerId = static_cast<unsigned>(tmpDealerPos); startData.startDealerPlayerId = static_cast<unsigned>(tmpDealerPos);