minimum raise setting (I)

This commit is contained in:
floty
2007-09-02 19:20:49 +00:00
parent 5840937432
commit f6f997ca3b
7 changed files with 189 additions and 139 deletions
+4
View File
@@ -37,6 +37,10 @@ public:
virtual void setLastActionPlayer( int theValue ) =0;
virtual int getLastActionPlayer() const =0;
virtual void setMinimumRaise (int) =0;
virtual int getMinimumRaise() const =0;
virtual void resetFirstRun() =0;
virtual void nextPlayer() =0;
+1 -1
View File
@@ -14,7 +14,7 @@
using namespace std;
LocalBeRo::LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRun(1), firstRound(1), firstHeadsUpRound(1), playersTurn(dP), logBoardCardsDone(0)
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRun(1), firstRound(1), firstHeadsUpRound(1), playersTurn(dP), logBoardCardsDone(0), minimumRaise(2*sB)
{
int i;
+5
View File
@@ -38,6 +38,7 @@ public:
void run();
void postRiverRun() {};
protected:
@@ -64,6 +65,9 @@ protected:
void setLastActionPlayer ( int theValue ) { lastActionPlayer = theValue; }
int getLastActionPlayer() const { return lastActionPlayer; }
void setMinimumRaise ( int theValue ) { minimumRaise = theValue; }
int getMinimumRaise() const { return minimumRaise; }
private:
@@ -77,6 +81,7 @@ private:
int smallBlind;
int highestSet;
int minimumRaise;
bool firstRun;
bool firstRound;
+69 -69
View File
@@ -106,11 +106,11 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
case 1: {
tempBoardArray[0] = 43;
tempBoardArray[1] = 22;
tempBoardArray[2] = 35;
tempBoardArray[3] = 39;
tempBoardArray[4] = 13;
tempBoardArray[0] = 12;
tempBoardArray[1] = 11;
tempBoardArray[2] = 9;
tempBoardArray[3] = 17;
tempBoardArray[4] = 14;
myBoard->setMyCards(tempBoardArray);
@@ -122,8 +122,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player0
tempPlayerArray[0] = 1;
tempPlayerArray[1] = 9;
tempPlayerArray[0] = 34;
tempPlayerArray[1] = 33;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -134,8 +134,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player1
tempPlayerArray[0] = 3;
tempPlayerArray[1] = 4;
tempPlayerArray[0] = 47;
tempPlayerArray[1] = 45;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -144,70 +144,70 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
playerArray[1]->setMyBestHandPosition(temp5Array);
// player2
tempPlayerArray[0] = 7;
tempPlayerArray[1] = 17;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
playerArray[2]->setMyCards(tempPlayerArray);
playerArray[2]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
playerArray[2]->setMyBestHandPosition(temp5Array);
// player3
tempPlayerArray[0] = 26;
tempPlayerArray[1] = 28;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
playerArray[3]->setMyCards(tempPlayerArray);
playerArray[3]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
playerArray[3]->setMyBestHandPosition(temp5Array);
// // player2
//
// tempPlayerArray[0] = 7;
// tempPlayerArray[1] = 17;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// playerArray[2]->setMyCards(tempPlayerArray);
// playerArray[2]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// playerArray[2]->setMyBestHandPosition(temp5Array);
//
// // player3
//
// tempPlayerArray[0] = 26;
// tempPlayerArray[1] = 28;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// playerArray[3]->setMyCards(tempPlayerArray);
// playerArray[3]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// playerArray[3]->setMyBestHandPosition(temp5Array);
} break;
case 2: {
tempBoardArray[0] = 32;
tempBoardArray[1] = 26;
tempBoardArray[2] = 28;
tempBoardArray[3] = 38;
tempBoardArray[4] = 7;
myBoard->setMyCards(tempBoardArray);
tempPlayerAndBoardArray[2] = tempBoardArray[0];
tempPlayerAndBoardArray[3] = tempBoardArray[1];
tempPlayerAndBoardArray[4] = tempBoardArray[2];
tempPlayerAndBoardArray[5] = tempBoardArray[3];
tempPlayerAndBoardArray[6] = tempBoardArray[4];
// player0
tempPlayerArray[0] = 45;
tempPlayerArray[1] = 35;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
playerArray[0]->setMyCards(tempPlayerArray);
playerArray[0]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
playerArray[0]->setMyBestHandPosition(temp5Array);
// player1
tempPlayerArray[0] = 34;
tempPlayerArray[1] = 39;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
playerArray[1]->setMyCards(tempPlayerArray);
playerArray[1]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
playerArray[1]->setMyBestHandPosition(temp5Array);
// tempBoardArray[0] = 32;
// tempBoardArray[1] = 26;
// tempBoardArray[2] = 28;
// tempBoardArray[3] = 38;
// tempBoardArray[4] = 7;
//
// myBoard->setMyCards(tempBoardArray);
//
// tempPlayerAndBoardArray[2] = tempBoardArray[0];
// tempPlayerAndBoardArray[3] = tempBoardArray[1];
// tempPlayerAndBoardArray[4] = tempBoardArray[2];
// tempPlayerAndBoardArray[5] = tempBoardArray[3];
// tempPlayerAndBoardArray[6] = tempBoardArray[4];
//
// // player0
//
// tempPlayerArray[0] = 45;
// tempPlayerArray[1] = 35;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// playerArray[0]->setMyCards(tempPlayerArray);
// playerArray[0]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// playerArray[0]->setMyBestHandPosition(temp5Array);
//
// // player1
//
// tempPlayerArray[0] = 34;
// tempPlayerArray[1] = 39;
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
//
// playerArray[1]->setMyCards(tempPlayerArray);
// playerArray[1]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
//
// playerArray[1]->setMyBestHandPosition(temp5Array);
// // player2
//
+90 -68
View File
@@ -36,17 +36,17 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
if(myID==0) {
// myActiveStatus=0;
myCash=11980;
// myCash=11980;
}
if(myID==1) {
myCash=4505;
// myCash=4505;
}
if(myID==2) {
myCash=9985;
// myCash=9985;
}
if(myID==3) {
myCash=8530;
// myCash=8530;
}
}
@@ -236,9 +236,9 @@ void LocalPlayer::preflopEngine() {
// raise-Betrag ermitteln
raise = (((int)myOdds-myNiveau[2])/2)*2*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips oder knappem raise
if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
@@ -319,9 +319,9 @@ void LocalPlayer::preflopEngine() {
// raise-Betrag ermitteln
raise = (sBluff/(8-actualHand->getActualQuantityPlayers()))*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips oder knappem raise
if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
@@ -337,6 +337,14 @@ void LocalPlayer::preflopEngine() {
}
// minimum raise setting and resetting
if(myAction == 5 && raise < actualHand->getCurrentBeRo()->getMinimumRaise()) {
raise = actualHand->getCurrentBeRo()->getMinimumRaise();
}
actualHand->getCurrentBeRo()->setMinimumRaise(raise);
// cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl;
if(DEBUG_MODE) {
@@ -347,12 +355,12 @@ void LocalPlayer::preflopEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CALL;
// myAction = PLAYER_ACTION_CALL;
}
break;
case 2: {
myAction = PLAYER_ACTION_RAISE;
raise = 25;
// myAction = PLAYER_ACTION_RAISE;
// raise = 25;
}
break;
default: {
@@ -365,7 +373,7 @@ void LocalPlayer::preflopEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CALL;
// myAction = PLAYER_ACTION_CALL;
// raise = 20;
// if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL;
@@ -386,7 +394,9 @@ void LocalPlayer::preflopEngine() {
}
break;
case 3: { myAction = PLAYER_ACTION_CALL; }
case 3: {
// myAction = PLAYER_ACTION_CALL;
}
break;
default: {}
}
@@ -479,9 +489,9 @@ void LocalPlayer::flopEngine() {
// raise-Betrag ermitteln
raise = (((int)myOdds-myNiveau[2])/5)*2*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips oder knappem raise
if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) {
raise = myCash;
@@ -583,9 +593,9 @@ void LocalPlayer::flopEngine() {
Tools::getRandNumber(1,8,1,&rand,0);
raise = rand*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips oder knappem raise
if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
@@ -623,6 +633,12 @@ void LocalPlayer::flopEngine() {
}
// minimum raise setting and resetting
if(myAction == 5 && raise < actualHand->getCurrentBeRo()->getMinimumRaise()) {
raise = actualHand->getCurrentBeRo()->getMinimumRaise();
}
actualHand->getCurrentBeRo()->setMinimumRaise(raise);
if(DEBUG_MODE) {
switch(myID) {
case 0: {
@@ -631,10 +647,10 @@ void LocalPlayer::flopEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CHECK;
if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
myAction = PLAYER_ACTION_CALL;
}
// myAction = PLAYER_ACTION_CHECK;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL;
// }
} break;
case 2: {
// myAction = PLAYER_ACTION_BET;
@@ -648,8 +664,8 @@ void LocalPlayer::flopEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_BET;
bet = 10;
// myAction = PLAYER_ACTION_BET;
// bet = 10;
// raise = 20;
// if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL;
@@ -673,10 +689,10 @@ void LocalPlayer::flopEngine() {
case 3: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CHECK;
if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
myAction = PLAYER_ACTION_CALL;
}
// myAction = PLAYER_ACTION_CHECK;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
case 2: {
@@ -1044,9 +1060,9 @@ void LocalPlayer::turnEngine() {
// raise-Betrag ermitteln
raise = (((int)myOdds-myNiveau[2])/4)*2*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips oder knappem raise
if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) {
raise = myCash;
@@ -1145,9 +1161,9 @@ void LocalPlayer::turnEngine() {
Tools::getRandNumber(1,8,1,&rand,0);
raise = rand*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips oder knappem raise
if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
@@ -1185,9 +1201,11 @@ void LocalPlayer::turnEngine() {
}
// cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl;
// cout << "myAction: " << myAction << endl;
// minimum raise setting and resetting
if(myAction == 5 && raise < actualHand->getCurrentBeRo()->getMinimumRaise()) {
raise = actualHand->getCurrentBeRo()->getMinimumRaise();
}
actualHand->getCurrentBeRo()->setMinimumRaise(raise);
if(DEBUG_MODE) {
@@ -1200,10 +1218,10 @@ void LocalPlayer::turnEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CALL;
if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
myAction = PLAYER_ACTION_FOLD;
}
// myAction = PLAYER_ACTION_CALL;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
// myAction = PLAYER_ACTION_FOLD;
// }
}
break;
case 2: {
@@ -1220,11 +1238,11 @@ void LocalPlayer::turnEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_RAISE;
raise = 40;
if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
myAction = PLAYER_ACTION_CALL;
}
// myAction = PLAYER_ACTION_RAISE;
// raise = 40;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
case 2: {
@@ -1244,11 +1262,11 @@ void LocalPlayer::turnEngine() {
case 3: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_BET;
bet = 10;
if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
myAction = PLAYER_ACTION_CALL;
}
// myAction = PLAYER_ACTION_BET;
// bet = 10;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_CALL;
// }
}
break;
case 2: {
@@ -1366,9 +1384,9 @@ void LocalPlayer::riverEngine() {
// raise-Betrag ermitteln
raise = (((int)myOdds-myNiveau[2])/2)*2*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips
if(myCash/(2*actualHand->getSmallBlind()) <= 8) {
raise = myCash;
@@ -1459,9 +1477,9 @@ void LocalPlayer::riverEngine() {
Tools::getRandNumber(1,8,1,&rand,0);
raise = rand*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
raise = actualHand->getCurrentBeRo()->getHighestSet();
}
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
// }
// all in bei nur wenigen Chips oder knappem raise
if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
@@ -1499,7 +1517,11 @@ void LocalPlayer::riverEngine() {
}
// cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl;
// minimum raise setting and resetting
if(myAction == 5 && raise < actualHand->getCurrentBeRo()->getMinimumRaise()) {
raise = actualHand->getCurrentBeRo()->getMinimumRaise();
}
actualHand->getCurrentBeRo()->setMinimumRaise(raise);
if(DEBUG_MODE) {
switch(myID) {
@@ -1526,7 +1548,7 @@ void LocalPlayer::riverEngine() {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_CALL;
// myAction = PLAYER_ACTION_CALL;
// raise = 40;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 100) {
// myAction = PLAYER_ACTION_CALL;
@@ -1550,12 +1572,12 @@ void LocalPlayer::riverEngine() {
case 3: {
switch(actualHand->getMyID()) {
case 1: {
myAction = PLAYER_ACTION_BET;
bet = 120;
if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
myAction = PLAYER_ACTION_RAISE;
raise = 10000;
}
// myAction = PLAYER_ACTION_BET;
// bet = 120;
// if(actualHand->getCurrentBeRo()->getHighestSet() > 0) {
// myAction = PLAYER_ACTION_RAISE;
// raise = 10000;
// }
}
break;
case 2: {
+14 -1
View File
@@ -12,7 +12,7 @@
#include "clientbero.h"
ClientBeRo::ClientBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), highestCardsValue(0), myBeRoID(gS), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRound(1), playersTurn(dP)
: BeRoInterface(), myHand(hi), highestCardsValue(0), myBeRoID(gS), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRound(1), playersTurn(dP), minimumRaise(0)
{
}
@@ -123,6 +123,19 @@ ClientBeRo::getSmallBlind() const
return smallBlind;
}
void
ClientBeRo::setMinimumRaise ( int theValue )
{
minimumRaise = theValue;
}
int
ClientBeRo::getMinimumRaise() const
{
return minimumRaise;
}
void
ClientBeRo::resetFirstRun()
{
+6
View File
@@ -48,6 +48,10 @@ public:
void setSmallBlind(int theValue);
int getSmallBlind() const;
void setMinimumRaise ( int theValue );
int getMinimumRaise() const;
void resetFirstRun();
void nextPlayer();
@@ -70,6 +74,8 @@ private:
int smallBlindPosition;
int smallBlind;
int minimumRaise;
int lastActionPlayer;
};