bugfix full bet rule
This commit is contained in:
@@ -96,7 +96,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
|
|
||||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEBUGGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEBUGGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
|
||||||
|
|
||||||
if(DEBUG_MODE) {
|
if(DEBUG_MODE) {
|
||||||
|
|
||||||
//QSqlDatabase *mySqliteLogDb;
|
//QSqlDatabase *mySqliteLogDb;
|
||||||
|
|
||||||
@@ -118,11 +118,11 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
|
|
||||||
case 1: {
|
case 1: {
|
||||||
|
|
||||||
tempBoardArray[0] = 39;
|
tempBoardArray[0] = 4;
|
||||||
tempBoardArray[1] = 2;
|
tempBoardArray[1] = 19;
|
||||||
tempBoardArray[2] = 3;
|
tempBoardArray[2] = 20;
|
||||||
tempBoardArray[3] = 4;
|
tempBoardArray[3] = 43;
|
||||||
tempBoardArray[4] = 5;
|
tempBoardArray[4] = 49;
|
||||||
|
|
||||||
myBoard->setMyCards(tempBoardArray);
|
myBoard->setMyCards(tempBoardArray);
|
||||||
|
|
||||||
@@ -135,8 +135,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
// player0
|
// player0
|
||||||
it = seatsList->begin();
|
it = seatsList->begin();
|
||||||
|
|
||||||
tempPlayerArray[0] = 13;
|
tempPlayerArray[0] = 18;
|
||||||
tempPlayerArray[1] = 14;
|
tempPlayerArray[1] = 17;
|
||||||
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||||
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||||
|
|
||||||
@@ -148,8 +148,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
// player1
|
// player1
|
||||||
it++;
|
it++;
|
||||||
|
|
||||||
tempPlayerArray[0] = 18;
|
tempPlayerArray[0] = 31;
|
||||||
tempPlayerArray[1] = 17;
|
tempPlayerArray[1] = 8;
|
||||||
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||||
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||||
|
|
||||||
@@ -426,22 +426,22 @@ void LocalHand::assignButtons() {
|
|||||||
nextActivePlayerFound = true;
|
nextActivePlayerFound = true;
|
||||||
if(activePlayerList->size() > 2) {
|
if(activePlayerList->size() > 2) {
|
||||||
//small blind normal
|
//small blind normal
|
||||||
(*it)->setMyButton(2);
|
(*it)->setMyButton(2);
|
||||||
} else {
|
} else {
|
||||||
//big blind in heads up
|
//big blind in heads up
|
||||||
(*it)->setMyButton(3);
|
(*it)->setMyButton(3);
|
||||||
// lastPlayerAction for showing cards
|
// lastPlayerAction for showing cards
|
||||||
lastActionPlayer = (*it)->getMyUniqueID();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// first player after dealer have to show his cards first (in showdown)
|
||||||
|
lastActionPlayer = (*it)->getMyUniqueID();
|
||||||
|
|
||||||
it++;
|
it++;
|
||||||
if(it == activePlayerList->end()) it = activePlayerList->begin();
|
if(it == activePlayerList->end()) it = activePlayerList->begin();
|
||||||
|
|
||||||
if(activePlayerList->size() > 2) {
|
if(activePlayerList->size() > 2) {
|
||||||
//big blind normal
|
//big blind normal
|
||||||
(*it)->setMyButton(3);
|
(*it)->setMyButton(3);
|
||||||
// lastPlayerAction for showing cards
|
|
||||||
lastActionPlayer = (*it)->getMyUniqueID();
|
|
||||||
} else {
|
} else {
|
||||||
//small blind in heads up
|
//small blind in heads up
|
||||||
(*it)->setMyButton(2);
|
(*it)->setMyButton(2);
|
||||||
|
|||||||
@@ -861,31 +861,31 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
|
|||||||
switch(myUniqueID) {
|
switch(myUniqueID) {
|
||||||
|
|
||||||
case 0: {
|
case 0: {
|
||||||
myCash=1000;
|
myCash=2588;
|
||||||
} break;
|
} break;
|
||||||
case 1: {
|
case 1: {
|
||||||
myCash=1000;
|
myCash=0;
|
||||||
} break;
|
} break;
|
||||||
case 2: {
|
case 2: {
|
||||||
myCash=1000;
|
myCash=404;
|
||||||
} break;
|
} break;
|
||||||
case 3: {
|
case 3: {
|
||||||
myCash=2000;
|
myCash=0;
|
||||||
} break;
|
} break;
|
||||||
case 4: {
|
case 4: {
|
||||||
myCash=3000;
|
myCash=0;
|
||||||
} break;
|
} break;
|
||||||
case 5: {
|
case 5: {
|
||||||
myCash=2000;
|
myCash=1133;
|
||||||
} break;
|
} break;
|
||||||
case 6: {
|
case 6: {
|
||||||
myCash=2100;
|
myCash=5275;
|
||||||
} break;
|
} break;
|
||||||
case 7: {
|
case 7: {
|
||||||
myCash=500;
|
myCash=0;
|
||||||
} break;
|
} break;
|
||||||
case 8: {
|
case 8: {
|
||||||
myCash=1000;
|
myCash=0;
|
||||||
} break;
|
} break;
|
||||||
case 9: {
|
case 9: {
|
||||||
myCash=0;
|
myCash=0;
|
||||||
@@ -1356,8 +1356,8 @@ void LocalPlayer::preflopEngine() {
|
|||||||
|
|
||||||
switch(currentHand->getMyID()) {
|
switch(currentHand->getMyID()) {
|
||||||
case 1: {
|
case 1: {
|
||||||
myAction = PLAYER_ACTION_CALL;
|
myAction = PLAYER_ACTION_RAISE;
|
||||||
// raise = 20;
|
raise = 20000;
|
||||||
// if(mySet >= 40) {
|
// if(mySet >= 40) {
|
||||||
// myAction = PLAYER_ACTION_CALL;
|
// myAction = PLAYER_ACTION_CALL;
|
||||||
// }
|
// }
|
||||||
@@ -1425,8 +1425,8 @@ void LocalPlayer::preflopEngine() {
|
|||||||
break;
|
break;
|
||||||
case 5: {
|
case 5: {
|
||||||
// if(mySet == 0) {
|
// if(mySet == 0) {
|
||||||
myAction = PLAYER_ACTION_CALL;
|
myAction = PLAYER_ACTION_FOLD;
|
||||||
raise = 20;
|
// raise = 20;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -3095,18 +3095,26 @@ void LocalPlayer::evaluation(int bet, int raise) {
|
|||||||
}
|
}
|
||||||
// all in
|
// all in
|
||||||
if(highestSet + raise >= myCash + mySet) {
|
if(highestSet + raise >= myCash + mySet) {
|
||||||
// -> full bet rule
|
|
||||||
if(highestSet + currentHand->getCurrentBeRo()->getMinimumRaise() > myCash + mySet) {
|
if(highestSet + currentHand->getCurrentBeRo()->getMinimumRaise() > myCash + mySet) {
|
||||||
currentHand->getCurrentBeRo()->setFullBetRule(true);
|
// perhaps full bet rule
|
||||||
} else {
|
if(highestSet >= myCash + mySet) {
|
||||||
// lastPlayerAction für Karten umblättern reihenfolge setzrn
|
// only call all-in
|
||||||
currentHand->setLastActionPlayer(myUniqueID);
|
mySet += myCash;
|
||||||
|
myCash = 0;
|
||||||
|
myAction = 6;
|
||||||
|
} else {
|
||||||
|
// raise, but not enough --> full bet rule
|
||||||
|
currentHand->getCurrentBeRo()->setFullBetRule(true);
|
||||||
|
// lastPlayerAction für Karten umblättern reihenfolge setzrn
|
||||||
|
currentHand->setLastActionPlayer(myUniqueID);
|
||||||
|
|
||||||
|
mySet += myCash;
|
||||||
|
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
|
||||||
|
myCash = 0;
|
||||||
|
myAction = 6;
|
||||||
|
highestSet = mySet;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mySet += myCash;
|
|
||||||
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
|
|
||||||
myCash = 0;
|
|
||||||
myAction = 6;
|
|
||||||
if(mySet > highestSet) highestSet = mySet;
|
|
||||||
}
|
}
|
||||||
// sonst
|
// sonst
|
||||||
else {
|
else {
|
||||||
|
|||||||
+3
-3
@@ -42,10 +42,10 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
|
|
||||||
dealerPosition = startData.startDealerPlayerId;
|
dealerPosition = startData.startDealerPlayerId;
|
||||||
|
|
||||||
if(DEBUG_MODE) {
|
if(DEBUG_MODE) {
|
||||||
startSmallBlind = 10;
|
startSmallBlind = 300;
|
||||||
currentSmallBlind = startSmallBlind;
|
currentSmallBlind = startSmallBlind;
|
||||||
dealerPosition = 3;
|
dealerPosition = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
Reference in New Issue
Block a user