applying astyle

This commit is contained in:
floty
2011-10-26 22:29:47 +00:00
parent fa01ab57d6
commit 7f13da91e5
38 changed files with 443 additions and 447 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ public:
virtual void setSets(int theValue) =0;
virtual void setAllInCondition(bool theValue) =0;
virtual void setLastActionPlayerID(unsigned theValue) =0;
virtual void setLastActionPlayerID(unsigned theValue) =0;
//
virtual void collectSets() =0;
virtual void collectPot() =0;
+1 -1
View File
@@ -34,7 +34,7 @@ public:
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp) =0;
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) =0;
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB) =0;
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB) =0;
};
#endif
+6 -6
View File
@@ -52,8 +52,8 @@ public:
virtual void setStartQuantityPlayers(int theValue) =0;
virtual int getStartQuantityPlayers() const =0;
virtual void setCurrentRound(GameState theValue) =0;
virtual GameState getCurrentRound() const =0;
virtual void setCurrentRound(GameState theValue) =0;
virtual GameState getCurrentRound() const =0;
virtual void setDealerPosition(int theValue) =0;
virtual int getDealerPosition() const =0;
@@ -70,11 +70,11 @@ public:
virtual void setBettingRoundsPlayed(int theValue) =0;
virtual int getBettingRoundsPlayed() const =0;
virtual void setPreviousPlayerID(int theValue) =0;
virtual int getPreviousPlayerID() const =0;
virtual void setPreviousPlayerID(int theValue) =0;
virtual int getPreviousPlayerID() const =0;
virtual void setLastActionPlayerID( unsigned theValue ) =0;
virtual unsigned getLastActionPlayerID() const =0;
virtual void setLastActionPlayerID( unsigned theValue ) =0;
virtual unsigned getLastActionPlayerID() const =0;
virtual void setCardsShown(bool theValue) =0;
virtual bool getCardsShown() const =0;
+3 -3
View File
@@ -25,7 +25,7 @@
using namespace std;
LocalBeRo::LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), fullBetRule(false), firstRun(true), firstRunGui(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false)
: BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), fullBetRule(false), firstRun(true), firstRunGui(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false)
{
currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
lastPlayersTurnIt = myHand->getRunningPlayerList()->begin();
@@ -84,7 +84,7 @@ void LocalBeRo::run()
if(firstRunGui) {
firstRunGui = false;
myHand->setPreviousPlayerID(-1);
myHand->setPreviousPlayerID(-1);
myHand->getGuiInterface()->dealBeRoCards(myBeRoID);
} else {
@@ -176,7 +176,7 @@ void LocalBeRo::run()
// aktuelle bero nicht dran, weil alle Sets gleich sind
//also gehe in naechste bero
myHand->setCurrentRound(GameState(myBeRoID+1));
myHand->setCurrentRound(GameState(myBeRoID+1));
//Action loeschen und ActionButtons refresh
for(it_c=myHand->getRunningPlayerList()->begin(); it_c!=myHand->getRunningPlayerList()->end(); ++it_c) {
+1 -1
View File
@@ -28,7 +28,7 @@
class LocalBeRo : public BeRoInterface
{
public:
LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
~LocalBeRo();
GameState getMyBeRoID() const {
+1 -1
View File
@@ -28,7 +28,7 @@ class LocalBeRoFlop : public LocalBeRo
{
public:
LocalBeRoFlop(HandInterface*, unsigned, int);
LocalBeRoFlop(HandInterface*, unsigned, int);
~LocalBeRoFlop();
};
+21 -21
View File
@@ -83,28 +83,28 @@ void LocalBeRoPostRiver::postRiverRun()
//Pot auf 0 setzen
getMyHand()->getBoard()->setPot(0);
// logging hole Cards / Hands
int nonfoldPlayersCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonfoldPlayersCounter++;
}
if(nonfoldPlayersCounter>1) {
getMyHand()->getLog()->logHoleCardsHandName(5,getMyHand()->getActivePlayerList());
}
// logging hole Cards / Hands
int nonfoldPlayersCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonfoldPlayersCounter++;
}
if(nonfoldPlayersCounter>1) {
getMyHand()->getLog()->logHoleCardsHandName(5,getMyHand()->getActivePlayerList());
}
// logging winner if game is over
// wenn nur noch ein Spieler aktive "neues Spiel"-Dialog anzeigen
int playersPositiveCashCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) playersPositiveCashCounter++;
}
if (playersPositiveCashCounter==1) {
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) {
getMyHand()->getLog()->logPlayerAction(5,(*it_c)->getMyID()+1,LOG_ACTION_WIN_GAME);
}
}
}
// logging winner if game is over
// wenn nur noch ein Spieler aktive "neues Spiel"-Dialog anzeigen
int playersPositiveCashCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) playersPositiveCashCounter++;
}
if (playersPositiveCashCounter==1) {
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) {
getMyHand()->getLog()->logPlayerAction(5,(*it_c)->getMyID()+1,LOG_ACTION_WIN_GAME);
}
}
}
//starte die Animaionsreihe
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoPostRiver : public LocalBeRo
{
public:
LocalBeRoPostRiver(HandInterface*, int, int);
LocalBeRoPostRiver(HandInterface*, int, int);
~LocalBeRoPostRiver();
void setHighestCardsValue(int theValue) {
+1 -1
View File
@@ -28,7 +28,7 @@ class LocalBeRoPreflop : public LocalBeRo
{
public:
LocalBeRoPreflop(HandInterface*, unsigned, int);
LocalBeRoPreflop(HandInterface*, unsigned, int);
~LocalBeRoPreflop();
void run();
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoRiver : public LocalBeRo
{
public:
LocalBeRoRiver(HandInterface*, unsigned, int);
LocalBeRoRiver(HandInterface*, unsigned, int);
~LocalBeRoRiver();
};
+1 -1
View File
@@ -27,7 +27,7 @@ class HandInterface;
class LocalBeRoTurn : public LocalBeRo
{
public:
LocalBeRoTurn(HandInterface*, unsigned, int);
LocalBeRoTurn(HandInterface*, unsigned, int);
~LocalBeRoTurn();
};
+1 -1
View File
@@ -299,7 +299,7 @@ void LocalBoard::determinePlayerNeedToShowCards()
// cout << "lAP-Ende: " << currentHand->getLastActionPlayer() << endl;
// search lastActionPlayer
for(it_c = activePlayerList->begin(); it_c != activePlayerList->end(); ++it_c) {
if((*it_c)->getMyUniqueID() == lastActionPlayerID && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
if((*it_c)->getMyUniqueID() == lastActionPlayerID && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
lastActionPlayerIt = it_c;
// cout << (*it_c)->getMyUniqueID() << endl;
break;
+3 -3
View File
@@ -49,8 +49,8 @@ public:
void setAllInCondition(bool theValue) {
allInCondition = theValue;
}
void setLastActionPlayerID(unsigned theValue) {
lastActionPlayerID = theValue;
void setLastActionPlayerID(unsigned theValue) {
lastActionPlayerID = theValue;
}
int getPot() const {
@@ -100,7 +100,7 @@ private:
int sets;
unsigned dealerPosition;
bool allInCondition;
unsigned lastActionPlayerID;
unsigned lastActionPlayerID;
};
@@ -64,15 +64,15 @@ LocalEngineFactory::createBeRo(HandInterface *hi, unsigned dP, int sB)
{
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, dP, sB)));
return myBeRo;
+1 -1
View File
@@ -39,7 +39,7 @@ public:
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
private:
ConfigFile *myConfig;
+28 -28
View File
@@ -30,7 +30,7 @@
using namespace std;
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(GAME_STATE_PREFLOP), smallBlind(sB), startCash(sC), previousPlayerID(-1), lastActionPlayerID(0), allInCondition(false),
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(GAME_STATE_PREFLOP), smallBlind(sB), startCash(sC), previousPlayerID(-1), lastActionPlayerID(0), allInCondition(false),
cardsShown(false), bettingRoundsPlayed(0)
{
@@ -46,7 +46,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
// generate cards and assign to board and player
const int NumCards = 52;
int cardsArray[NumCards] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
@@ -367,7 +367,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
setBlinds();
myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind);
myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind);
}
@@ -448,8 +448,8 @@ void LocalHand::assignButtons()
}
// first player after dealer have to show his cards first (in showdown)
lastActionPlayerID = (*it)->getMyUniqueID();
myBoard->setLastActionPlayerID(lastActionPlayerID);
lastActionPlayerID = (*it)->getMyUniqueID();
myBoard->setLastActionPlayerID(lastActionPlayerID);
++it;
if(it == activePlayerList->end()) it = activePlayerList->begin();
@@ -528,29 +528,29 @@ void LocalHand::setBlinds()
void LocalHand::switchRounds()
{
// logging last player action
// currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
// if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) {
// throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
// }
// // logging last player action
// PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID);
// if(previousPlayerIt == runningPlayerList->end()) {
// throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
// }
// switch((*currentPlayersTurnIt)->getMyAction()) {
// switch((*previousPlayerIt)->getMyAction()) {
// case PLAYER_ACTION_FOLD: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_FOLD);
// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_FOLD);
// } break;
// case PLAYER_ACTION_CHECK: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CHECK);
// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CHECK);
// } break;
// case PLAYER_ACTION_CALL: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CALL);
// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CALL);
// } break;
// case PLAYER_ACTION_BET:
// case PLAYER_ACTION_RAISE: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_BET,(*currentPlayersTurnIt)->getMySet());
// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_BET,(*previousPlayerIt)->getMySet());
// } break;
// case PLAYER_ACTION_ALLIN: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*currentPlayersTurnIt)->getMySet());
// myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*previousPlayerIt)->getMySet());
// } break;
// default: {
// }
@@ -595,7 +595,7 @@ void LocalHand::switchRounds()
myBoard->collectPot();
myGui->refreshPot();
myGui->refreshSet();
currentRound = GAME_STATE_POST_RIVER;
currentRound = GAME_STATE_POST_RIVER;
}
// check for all in condition
@@ -655,16 +655,16 @@ void LocalHand::switchRounds()
myGui->refreshPot();
myGui->refreshSet();
myGui->flipHolecardsAllIn();
// Logging HoleCards
if(currentRound<GAME_STATE_RIVER) {
myLog->logHoleCardsHandName(currentRound+1,activePlayerList);
}
// Logging HoleCards
if(currentRound<GAME_STATE_RIVER) {
myLog->logHoleCardsHandName(currentRound+1,activePlayerList);
}
if (currentRound < GAME_STATE_POST_RIVER) // do not increment past 4
currentRound = GameState(currentRound + 1);
if (currentRound < GAME_STATE_POST_RIVER) // do not increment past 4
currentRound = GameState(currentRound + 1);
//log board cards for allin
if(currentRound >= GAME_STATE_FLOP) {
if(currentRound >= GAME_STATE_FLOP) {
int tempBoardCardsArray[5];
myBoard->getMyCards(tempBoardCardsArray);
@@ -675,10 +675,10 @@ void LocalHand::switchRounds()
}
//unhighlight current players groupbox
it_c = getActivePlayerIt(previousPlayerID);
it_c = getActivePlayerIt(previousPlayerID);
if( it_c != activePlayerList->end() ) {
// lastPlayersTurn is active
myGui->refreshGroupbox(previousPlayerID,1);
myGui->refreshGroupbox(previousPlayerID,1);
}
myGui->refreshGameLabels((GameState)getCurrentRound());
@@ -769,6 +769,6 @@ PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const
void LocalHand::setLastActionPlayerID(unsigned theValue)
{
lastActionPlayerID = theValue;
myBoard->setLastActionPlayerID(theValue);
lastActionPlayerID = theValue;
myBoard->setLastActionPlayerID(theValue);
}
+12 -12
View File
@@ -88,10 +88,10 @@ public:
return startQuantityPlayers;
}
void setCurrentRound(GameState theValue) {
void setCurrentRound(GameState theValue) {
currentRound = theValue;
}
GameState getCurrentRound() const {
GameState getCurrentRound() const {
return currentRound;
}
@@ -130,16 +130,16 @@ public:
return bettingRoundsPlayed;
}
void setPreviousPlayerID(int theValue) {
previousPlayerID = theValue;
void setPreviousPlayerID(int theValue) {
previousPlayerID = theValue;
}
int getPreviousPlayerID() const {
return previousPlayerID;
int getPreviousPlayerID() const {
return previousPlayerID;
}
void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayerID() const {
return lastActionPlayerID;
void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayerID() const {
return lastActionPlayerID;
}
void setCardsShown(bool theValue) {
@@ -177,12 +177,12 @@ private:
unsigned dealerPosition;
unsigned smallBlindPosition;
unsigned bigBlindPosition;
GameState currentRound;
GameState currentRound;
int smallBlind;
int startCash;
int previousPlayerID;
unsigned lastActionPlayerID;
int previousPlayerID;
unsigned lastActionPlayerID;
bool allInCondition;
bool cardsShown;
+157 -157
View File
@@ -847,7 +847,7 @@ static const RoundData FlopValues[] = {
LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar),
myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(PLAYER_ACTION_NONE),
myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(PLAYER_ACTION_NONE),
myButton(mB), myActiveStatus(aS), myStayOnTableStatus(1), myTurn(0), myCardsFlip(0), myRoundStartCash(0), lastMoneyWon(0),
sBluff(0), sBluffStatus(0), myWinnerState(false), m_actionTimeoutCounter(0), m_isConnected(false)
{
@@ -1066,7 +1066,7 @@ void LocalPlayer::action()
// cout << "jetzt" << endl;
//set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(myID);
currentHand->setPreviousPlayerID(myID);
currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
currentHand->getGuiInterface()->nextPlayerAnimation();
@@ -1222,16 +1222,16 @@ void LocalPlayer::preflopEngine()
// all in
if(myOdds >= myNiveau[2] + 8) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// nur call
else {
// all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
} else {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
@@ -1247,51 +1247,51 @@ void LocalPlayer::preflopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// auf cBluff testen --> call (bzw check) statt raise
if(cBluff > 90) {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
// bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
}
if(cBluff > 80 && myOdds >= myNiveau[2] + 4) {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
// bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
}
if(cBluff > 70 && myOdds >= myNiveau[2] + 8) {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
// bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
}
if(cBluff > 60 && myOdds >= myNiveau[2] + 12) {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
// bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
}
} else {
// call
if(myOdds >= myNiveau[0] || (mySet >= currentHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-8)) {
// bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
else {
// all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
} else {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
}
// fold
else {
// bigBlind -> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
else myAction = PLAYER_ACTION_FOLD;
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
else myAction = PLAYER_ACTION_FOLD;
}
}
@@ -1308,11 +1308,11 @@ void LocalPlayer::preflopEngine()
// all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/6) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
} else {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
// bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
}
}
// Standard-Raise-Routine
@@ -1327,12 +1327,12 @@ void LocalPlayer::preflopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// extrem hoher set der gegner -> bluff beenden
if((currentHand->getCurrentBeRo()->getHighestSet() >= 12*currentHand->getSmallBlind() && myOdds < myNiveau[0]) || (currentHand->getCurrentBeRo()->getHighestSet() >= 20*currentHand->getSmallBlind() && myOdds < myNiveau[2])) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
}
@@ -1590,16 +1590,16 @@ void LocalPlayer::flopEngine()
// all in
if(myOdds >= myNiveau[2] + 15) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// nur call
else {
// all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
} else {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
@@ -1615,14 +1615,14 @@ void LocalPlayer::flopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// auf cBluff testen --> call statt raise
if(cBluff > 90) myAction = PLAYER_ACTION_CALL;
if(cBluff > 80 && myOdds >= myNiveau[2] + 4) myAction = PLAYER_ACTION_CALL;
if(cBluff > 70 && myOdds >= myNiveau[2] + 8) myAction = PLAYER_ACTION_CALL;
if(cBluff > 60 && myOdds >= myNiveau[2] + 12) myAction = PLAYER_ACTION_CALL;
if(cBluff > 90) myAction = PLAYER_ACTION_CALL;
if(cBluff > 80 && myOdds >= myNiveau[2] + 4) myAction = PLAYER_ACTION_CALL;
if(cBluff > 70 && myOdds >= myNiveau[2] + 8) myAction = PLAYER_ACTION_CALL;
if(cBluff > 60 && myOdds >= myNiveau[2] + 12) myAction = PLAYER_ACTION_CALL;
} else {
// call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt
@@ -1630,12 +1630,12 @@ void LocalPlayer::flopEngine()
// all in bei knappem call
if(currentHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL;
}
// fold
else {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
}
}
} else {
@@ -1654,17 +1654,17 @@ void LocalPlayer::flopEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
// auf cBluff testen --> check statt bet
if(cBluff > 80) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 70 && myOdds >= myNiveau[1] + 4) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 60 && myOdds >= myNiveau[1] + 8) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 50 && myOdds >= myNiveau[1] + 12) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 80) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 70 && myOdds >= myNiveau[1] + 4) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 60 && myOdds >= myNiveau[1] + 8) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 50 && myOdds >= myNiveau[1] + 12) myAction = PLAYER_ACTION_CHECK;
}
// check
else {
myAction = PLAYER_ACTION_CHECK;
myAction = PLAYER_ACTION_CHECK;
// Position
if(myButton == 1) {
// Position-Bluff generieren
@@ -1683,7 +1683,7 @@ void LocalPlayer::flopEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
}
}
@@ -1701,7 +1701,7 @@ void LocalPlayer::flopEngine()
// Gegner setzen -> call
if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
// Standard-Raise-Routine
else {
@@ -1716,12 +1716,12 @@ void LocalPlayer::flopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// extrem hoher set der gegner -> bluff beenden
if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
}
}
} else {
@@ -1743,7 +1743,7 @@ void LocalPlayer::flopEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
}
@@ -1974,11 +1974,11 @@ void LocalPlayer::flopEngine()
// case 4: {
// Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 35) {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 8) {
// myAction = PLAYER_ACTION_ALLIN;
// myAction = PLAYER_ACTION_ALLIN;
// } else {
// if(cBluff < 60) {
// bet = (7-myDude4)*2*currentHand->getSmallBlind();
@@ -1986,7 +1986,7 @@ void LocalPlayer::flopEngine()
// bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind();
// }
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// }
// }
@@ -1996,11 +1996,11 @@ void LocalPlayer::flopEngine()
// case 2: {
// Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 35) {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 8) {
// myAction = PLAYER_ACTION_ALLIN;
// myAction = PLAYER_ACTION_ALLIN;
// } else {
// if(cBluff < 60) {
// bet = (5-myDude4)*2*currentHand->getSmallBlind();
@@ -2008,7 +2008,7 @@ void LocalPlayer::flopEngine()
// bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind();
// }
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// }
// }
@@ -2016,11 +2016,11 @@ void LocalPlayer::flopEngine()
// case 1: {
// Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 40) {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 6) {
// myAction = PLAYER_ACTION_ALLIN;
// myAction = PLAYER_ACTION_ALLIN;
// } else {
// if(cBluff < 60) {
// bet = (3-myDude4)*2*currentHand->getSmallBlind();
@@ -2028,7 +2028,7 @@ void LocalPlayer::flopEngine()
// bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind();
// }
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// }
// }
@@ -2038,10 +2038,10 @@ void LocalPlayer::flopEngine()
// if(info[1] >= 10 && sBluff <= 40) {
// bet = (sBluff/10)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// else {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// }
// }
@@ -2052,15 +2052,15 @@ void LocalPlayer::flopEngine()
// case 2: {
// Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff > 80) {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 6) {
// myAction = PLAYER_ACTION_ALLIN;
// myAction = PLAYER_ACTION_ALLIN;
// } else {
// bet = (cBluff/20)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// }
// }
@@ -2068,15 +2068,15 @@ void LocalPlayer::flopEngine()
// default: {
// Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff > 90) {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 5) {
// myAction = PLAYER_ACTION_ALLIN;
// myAction = PLAYER_ACTION_ALLIN;
// } else {
// bet = (cBluff/30)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// }
// }
@@ -2092,7 +2092,7 @@ void LocalPlayer::flopEngine()
// if(currentHand->getActivePlayerList().size() == 2) {
// bet = (1-myDude4)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
//
// }
// else {
@@ -2100,40 +2100,40 @@ void LocalPlayer::flopEngine()
// case 3: {
// if(sBluff <= 10) {
// bet = (sBluff/5 + 2)*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// else {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// }
// break;
// case 2: {
// if(sBluff <= 15) {
// bet = (sBluff/5 + 2)*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// else {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// }
// break;
// case 1: {
// if(sBluff <= 50) {
// bet = (sBluff/15 + 2)*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// else {
// myAction = PLAYER_ACTION_CHECK;
// myAction = PLAYER_ACTION_CHECK;
// }
// }
// break;
// default: {
// if(myCash/(2*currentHand->getSmallBlind()) <= 5) {
// myAction = PLAYER_ACTION_ALLIN;
// myAction = PLAYER_ACTION_ALLIN;
// } else {
// bet = (sBluff/15)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET;
// myAction = PLAYER_ACTION_BET;
// }
// }
// break;
@@ -2292,16 +2292,16 @@ void LocalPlayer::turnEngine()
// all in
if(myOdds >= myNiveau[2] + 15) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// nur call
else {
// all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
} else {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
@@ -2317,25 +2317,25 @@ void LocalPlayer::turnEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// auf cBluff testen --> call statt raise
if(cBluff > 90) myAction = PLAYER_ACTION_CALL;
if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CALL;
if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CALL;
if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CALL;
if(cBluff > 90) myAction = PLAYER_ACTION_CALL;
if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CALL;
if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CALL;
if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CALL;
} else {
// call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt
if(myOdds >= myNiveau[0] || (mySet >= currentHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) {
// all in bei knappem call
if(currentHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL;
}
// fold
else {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
}
}
}
@@ -2355,17 +2355,17 @@ void LocalPlayer::turnEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
// auf cBluff testen --> call statt raise
if(cBluff > 90) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 90) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CHECK;
}
// check
else {
myAction = PLAYER_ACTION_CHECK;
myAction = PLAYER_ACTION_CHECK;
// Position
if(myButton == 1) {
// Position-Bluff generieren
@@ -2384,7 +2384,7 @@ void LocalPlayer::turnEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
}
}
@@ -2401,7 +2401,7 @@ void LocalPlayer::turnEngine()
// Gegner setzen -> call
if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
// Standard-Raise-Routine
else {
@@ -2416,12 +2416,12 @@ void LocalPlayer::turnEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// extrem hoher set der gegner -> bluff beenden
if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
}
}
} else {
@@ -2443,7 +2443,7 @@ void LocalPlayer::turnEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
}
@@ -2813,16 +2813,16 @@ void LocalPlayer::riverEngine()
// all in
if(myOdds >= myNiveau[2] + 15) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// nur call
else {
// all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
} else {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
}
@@ -2838,7 +2838,7 @@ void LocalPlayer::riverEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 8) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
} else {
// call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt
@@ -2846,12 +2846,12 @@ void LocalPlayer::riverEngine()
// all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/4) {
raise = myCash;
myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL;
}
// fold
else {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
}
}
} else {
@@ -2869,11 +2869,11 @@ void LocalPlayer::riverEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
// check
else {
myAction = PLAYER_ACTION_CHECK;
myAction = PLAYER_ACTION_CHECK;
// Position
if(myButton == 1) {
// Position-Bluff generieren
@@ -2892,7 +2892,7 @@ void LocalPlayer::riverEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
}
}
@@ -2913,7 +2913,7 @@ void LocalPlayer::riverEngine()
// Gegner setzen -> call
if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
// Standard-Raise-Routine
else {
@@ -2928,12 +2928,12 @@ void LocalPlayer::riverEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash;
}
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
// extrem hoher set der gegner -> bluff beenden
if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
}
}
} else {
@@ -2955,7 +2955,7 @@ void LocalPlayer::riverEngine()
if(bet > (myCash*4.0)/5.0) {
bet = myCash;
}
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
}
@@ -3237,7 +3237,7 @@ void LocalPlayer::evaluation(int bet, int raise)
if(highestSet >= myCash + mySet) {
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
// cout << "evaluation(call) - mySet: " << mySet << endl;
}
@@ -3260,7 +3260,7 @@ void LocalPlayer::evaluation(int bet, int raise)
currentHand->getCurrentBeRo()->setMinimumRaise(myCash);
mySet = myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
}
@@ -3274,7 +3274,7 @@ void LocalPlayer::evaluation(int bet, int raise)
}
// lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID);
currentHand->setLastActionPlayerID(myUniqueID);
}
break;
// raise
@@ -3284,14 +3284,14 @@ void LocalPlayer::evaluation(int bet, int raise)
if(highestSet >= myCash + mySet) {
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
}
// sonst
else {
myCash = myCash - highestSet + mySet;
mySet = highestSet;
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet);
}
} else {
@@ -3306,27 +3306,27 @@ void LocalPlayer::evaluation(int bet, int raise)
// only call all-in
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
} else {
// raise, but not enough --> full bet rule
currentHand->getCurrentBeRo()->setFullBetRule(true);
// lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID);
currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash;
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet;
}
} else {
// lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID);
currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash;
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet;
}
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
@@ -3338,7 +3338,7 @@ void LocalPlayer::evaluation(int bet, int raise)
mySet = highestSet + raise;
highestSet = mySet;
// lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID);
currentHand->setLastActionPlayerID(myUniqueID);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet);
}
}
@@ -4470,7 +4470,7 @@ void LocalPlayer::preflopEngine3()
// FOLD --> wenn Potential negativ oder HighestSet zu hoch
if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 2 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 4 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 10 * tempFold * currentHand->getSmallBlind() && potential<4)) && CardsValue::holeCardsClass(myCards[0], myCards[1]) < 9 && bluff > 15) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
} else {
// RAISE --> wenn hohes Potential
if((potential >= 4 && 6 * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || bluff <= 6) {
@@ -4489,14 +4489,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
} else {
// doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!!
@@ -4507,14 +4507,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
} else raise = (potential - 4 ) * 2 * currentHand->getCurrentBeRo()->getHighestSet();
@@ -4535,14 +4535,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
} else {
// doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!!
@@ -4553,14 +4553,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
} else raise = (potential - 3 ) * currentHand->getCurrentBeRo()->getHighestSet();
}
@@ -4573,7 +4573,7 @@ void LocalPlayer::preflopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
}
@@ -4583,7 +4583,7 @@ void LocalPlayer::preflopEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
}
}
@@ -4591,7 +4591,7 @@ void LocalPlayer::preflopEngine3()
else {
// CHECK --> wenn alle Sets glieich bei BigBlind und nich zu hohem Potential
if(mySet == currentHand->getCurrentBeRo()->getHighestSet()) {
myAction = PLAYER_ACTION_CHECK;
myAction = PLAYER_ACTION_CHECK;
}
// CALL --> bei normalen Potential
else {
@@ -4600,14 +4600,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
}
@@ -4697,14 +4697,14 @@ void LocalPlayer::flopEngine3()
// FOLD --> wenn potential negativ oder HighestSet zu hoch
if(( potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 18) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
} else {
// CHECK und BET --> wenn noch keiner was gesetzt hat
if(currentHand->getCurrentBeRo()->getHighestSet() == 0) {
// CHECK --> wenn Potential klein oder check-bluff sonst bet oder bet-bluff
if((potential<3 || bluff >= 80) && bluff > 15) {
// check
myAction = PLAYER_ACTION_CHECK;
myAction = PLAYER_ACTION_CHECK;
}
// BET --> wenn Potential hoch
else {
@@ -4719,13 +4719,13 @@ void LocalPlayer::flopEngine3()
if(mySet >= myCash) {
mySet = myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash -= mySet;
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
currentHand->getCurrentBeRo()->setHighestSet(mySet);
}
@@ -4748,7 +4748,7 @@ void LocalPlayer::flopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
}
@@ -4758,7 +4758,7 @@ void LocalPlayer::flopEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
}
// CALL --> bei normalen Potential
@@ -4769,14 +4769,14 @@ void LocalPlayer::flopEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
}
@@ -4864,14 +4864,14 @@ void LocalPlayer::turnEngine3()
// FOLD
// --> wenn potential negativ oder HighestSet zu hoch
if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 15) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
} else {
// CHECK und BET --> wenn noch keiner was gesetzt hat
if(currentHand->getCurrentBeRo()->getHighestSet() == 0) {
// CHECK --> wenn Potential klein
if((potential<2 || bluff >= 80) && bluff > 10) {
// check
myAction = PLAYER_ACTION_CHECK;
myAction = PLAYER_ACTION_CHECK;
}
// BET --> wenn Potential hoch
else {
@@ -4887,13 +4887,13 @@ void LocalPlayer::turnEngine3()
if(mySet >= myCash) {
mySet = myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash -= mySet;
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
currentHand->getCurrentBeRo()->setHighestSet(mySet);
}
@@ -4916,7 +4916,7 @@ void LocalPlayer::turnEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
}
@@ -4926,7 +4926,7 @@ void LocalPlayer::turnEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
}
// CALL --> bei normalen Potential
@@ -4936,14 +4936,14 @@ void LocalPlayer::turnEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
}
@@ -5026,14 +5026,14 @@ void LocalPlayer::riverEngine3()
// FOLD
// --> wenn potential negativ oder HighestSet zu hoch
if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 15) {
myAction = PLAYER_ACTION_FOLD;
myAction = PLAYER_ACTION_FOLD;
} else {
// CHECK und BET --> wenn noch keiner was gesetzt hat
if(currentHand->getCurrentBeRo()->getHighestSet() == 0) {
// CHECK --> wenn Potential klein
if((potential<2 || bluff >= 92) && bluff > 15) {
// check
myAction = PLAYER_ACTION_CHECK;
myAction = PLAYER_ACTION_CHECK;
}
// BET --> wenn Potential hoch
else {
@@ -5049,13 +5049,13 @@ void LocalPlayer::riverEngine3()
if(mySet >= myCash) {
mySet = myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash -= mySet;
myAction = PLAYER_ACTION_BET;
myAction = PLAYER_ACTION_BET;
}
currentHand->getCurrentBeRo()->setHighestSet(mySet);
}
@@ -5078,7 +5078,7 @@ void LocalPlayer::riverEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
}
@@ -5088,7 +5088,7 @@ void LocalPlayer::riverEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE;
myAction = PLAYER_ACTION_RAISE;
}
}
// CALL --> bei normalen Potential
@@ -5098,14 +5098,14 @@ void LocalPlayer::riverEngine3()
mySet += myCash;
myCash = 0;
myAction = PLAYER_ACTION_ALLIN;
myAction = PLAYER_ACTION_ALLIN;
}
// sonst
else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
}
}
+3 -3
View File
@@ -113,12 +113,12 @@ public:
return myLastRelativeSet;
}
void setMyAction(PlayerAction theValue, bool blind = 0) {
void setMyAction(PlayerAction theValue, bool blind = 0) {
myAction = theValue;
// logging for human player
if(myAction && !blind) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
}
PlayerAction getMyAction() const {
PlayerAction getMyAction() const {
return myAction;
}
@@ -317,7 +317,7 @@ private:
int myCash;
int mySet;
int myLastRelativeSet;
PlayerAction myAction;
PlayerAction myAction;
int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big
bool myActiveStatus; // 0 = inactive, 1 = active
bool myStayOnTableStatus; // 0 = left, 1 = stay
+102 -103
View File
@@ -34,15 +34,15 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
if(SQLITE_LOG) {
// logging activated
if(myConfig->readConfigInt("LogOnOff")) {
if(myConfig->readConfigInt("LogOnOff")) {
DIR *logDir;
logDir = opendir((myConfig->readConfigString("LogDir")).c_str());
logDir = opendir((myConfig->readConfigString("LogDir")).c_str());
bool dirExists = logDir != NULL;
closedir(logDir);
// check if logging path exist
if(myConfig->readConfigString("LogDir") != "" && dirExists) {
if(myConfig->readConfigString("LogDir") != "" && dirExists) {
// detect current time
char curDateTime[20];
@@ -54,7 +54,7 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
strftime(curDate,11,"%Y-%m-%d",z);
strftime(curTime,9,"%H:%M:%S",z);
string mySqliteLogFileName = boost::lexical_cast<string>((myConfig->readConfigString("LogDir")).c_str());
string mySqliteLogFileName = boost::lexical_cast<string>((myConfig->readConfigString("LogDir")).c_str());
mySqliteLogFileName += "pokerth-log-" + boost::lexical_cast<string>(curDateTime) + ".pdb";
// open sqlite-db
@@ -63,23 +63,23 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
int i;
// create session table
sql += "CREATE TABLE Session (";
sql += "CREATE TABLE Session (";
sql += "PokerTH_Version TEXT NOT NULL";
sql += ",Date TEXT NOT NULL";
sql += ",Time TEXT NOT NULL";
sql += ", PRIMARY KEY(Date,Time));";
sql += ", PRIMARY KEY(Date,Time));";
sql += "INSERT INTO Session (";
sql += "INSERT INTO Session (";
sql += "PokerTH_Version";
sql += ",Date";
sql += ",Time";
sql += ") VALUES (";
sql += "\"" + boost::lexical_cast<string>(POKERTH_BETA_RELEASE_STRING) + "\",";
sql += "\"" + boost::lexical_cast<string>(curDate) + "\",";
sql += "\"" + boost::lexical_cast<string>(curTime) + "\");";
sql += "\"" + boost::lexical_cast<string>(curTime) + "\");";
// create game table
sql += "CREATE TABLE Game (";
sql += "CREATE TABLE Game (";
sql += "GameID INTEGER NOT NULL PRIMARY KEY";
sql += ",Startmoney INTEGER NOT NULL";
sql += ",StartSb INTEGER NOT NULL";
@@ -88,10 +88,10 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
sql += ",Seat_" + boost::lexical_cast<std::string>(i) + " TEXT";
}
sql += ",Winner_Seat INTEGER";
sql += ");";
sql += ");";
// create hand table
sql += "CREATE TABLE Hand (";
sql += "CREATE TABLE Hand (";
sql += "HandID INTEGER NOT NULL";
sql += ",GameID INTEGER NOT NULL";
sql += ",Dealer_Seat INTEGER";
@@ -109,10 +109,10 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
for(i=1; i<=5; i++) {
sql += ",BoardCard_" + boost::lexical_cast<std::string>(i) + " INTEGER";
}
sql += ",PRIMARY KEY(HandID,GameID));";
sql += ",PRIMARY KEY(HandID,GameID));";
// create action table
sql += "CREATE TABLE Action (";
sql += "CREATE TABLE Action (";
sql += "ActionID INTEGER PRIMARY KEY AUTOINCREMENT";
sql += ",HandID INTEGER NOT NULL";
sql += ",GameID INTEGER NOT NULL";
@@ -120,9 +120,9 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
sql += ",Player INTEGER NOT NULL";
sql += ",Action TEXT NOT NULL";
sql += ",Amount INTEGER";
sql += ");";
sql += ");";
exec_transaction(&sql);
exec_transaction(&sql);
}
}
}
@@ -143,7 +143,7 @@ void Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned
if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) {
if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled
PlayerListConstIterator it_c;
@@ -152,7 +152,7 @@ void Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned
// sqlite-db is open
int i;
sql += "INSERT INTO Game (";
sql += "INSERT INTO Game (";
sql += "GameID";
sql += ",Startmoney";
sql += ",StartSb";
@@ -172,8 +172,8 @@ void Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned
sql += ",NULL";
}
}
sql += ");";
exec_transaction(&sql);
sql += ");";
exec_transaction(&sql);
}
}
}
@@ -183,11 +183,11 @@ void Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, uns
{
curHandID = handID;
logHoleCardsDone = false;
logHoleCardsDone = false;
if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) {
if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled
PlayerListConstIterator it_c;
@@ -196,7 +196,7 @@ void Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, uns
// sqlite-db is open
int i;
sql += "INSERT INTO Hand (";
sql += "INSERT INTO Hand (";
sql += "HandID";
sql += ",GameID";
sql += ",Dealer_Seat";
@@ -222,31 +222,30 @@ void Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, uns
sql += ",NULL";
}
}
sql += ");";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
sql += ");";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
// !! TODO !! Hack, weil Button-Regel noch falsch und dealerPosition noch teilweise falsche ID enthält (HeadsUp: dealerPosition=bigBlindPosition <-- falsch)
bool dealerButtonOnTable = false;
int countActivePlayer = 0;
for(it_c = seatsList->begin(); it_c!=seatsList->end(); it_c++) {
if((*it_c)->getMyActiveStatus()) {
countActivePlayer++;
if((*it_c)->getMyButton()==BUTTON_DEALER && (*it_c)->getMyActiveStatus()) {
dealerButtonOnTable = true;
}
}
}
if(countActivePlayer==2) {
logPlayerAction(0,smallBlindPosition,LOG_ACTION_DEALER);
}
else {
if(dealerButtonOnTable) {
logPlayerAction(0,dealerPosition,LOG_ACTION_DEALER);
}
}
// !! TODO !! Hack
// !! TODO !! Hack, weil Button-Regel noch falsch und dealerPosition noch teilweise falsche ID enthält (HeadsUp: dealerPosition=bigBlindPosition <-- falsch)
bool dealerButtonOnTable = false;
int countActivePlayer = 0;
for(it_c = seatsList->begin(); it_c!=seatsList->end(); it_c++) {
if((*it_c)->getMyActiveStatus()) {
countActivePlayer++;
if((*it_c)->getMyButton()==BUTTON_DEALER && (*it_c)->getMyActiveStatus()) {
dealerButtonOnTable = true;
}
}
}
if(countActivePlayer==2) {
logPlayerAction(0,smallBlindPosition,LOG_ACTION_DEALER);
} else {
if(dealerButtonOnTable) {
logPlayerAction(0,dealerPosition,LOG_ACTION_DEALER);
}
}
// !! TODO !! Hack
}
}
}
@@ -257,13 +256,13 @@ void Log::logPlayerAction(int bero, int seat, PlayerActionLog action, int amount
if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) {
if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled
if( mySqliteLogDb != 0 ) {
// sqlite-db is open
sql += "INSERT INTO Action (";
sql += "INSERT INTO Action (";
sql += "HandID";
sql += ",GameID";
sql += ",BeRo";
@@ -326,10 +325,10 @@ void Log::logPlayerAction(int bero, int seat, PlayerActionLog action, int amount
} else {
sql += ",NULL";
}
sql += ");";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
sql += ");";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
}
}
}
@@ -339,7 +338,7 @@ void Log::logBoardCards(int bero, int boardCards[5])
{
if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) {
if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled
if( mySqliteLogDb != 0 ) {
@@ -347,19 +346,19 @@ void Log::logBoardCards(int bero, int boardCards[5])
switch(bero) {
case 2: {
sql += "UPDATE Hand SET ";
sql += "UPDATE Hand SET ";
sql += "BoardCard_1=" + boost::lexical_cast<string>(boardCards[0]) + ",";
sql += "BoardCard_2=" + boost::lexical_cast<string>(boardCards[1]) + ",";
sql += "BoardCard_3=" + boost::lexical_cast<string>(boardCards[2]);
}
break;
case 3: {
sql += "UPDATE Hand SET ";
sql += "UPDATE Hand SET ";
sql += "BoardCard_4=" + boost::lexical_cast<string>(boardCards[3]);
}
break;
case 4: {
sql += "UPDATE Hand SET ";
sql += "UPDATE Hand SET ";
sql += "BoardCard_5=" + boost::lexical_cast<string>(boardCards[4]);
}
break;
@@ -369,10 +368,10 @@ void Log::logBoardCards(int bero, int boardCards[5])
sql += " WHERE ";
sql += "GameID=" + boost::lexical_cast<string>(curGameID) + " AND ";
sql += "HandID=" + boost::lexical_cast<string>(curHandID);
sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
}
}
}
@@ -382,47 +381,47 @@ void Log::logHoleCardsHandName(int bero, PlayerList activePlayerList)
{
if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) {
if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled
if( mySqliteLogDb != 0 && (bero==5 || !logHoleCardsDone)) {
// sqlite-db is open and we are in postriver or before postriver doesn't log hole cards til now
if( mySqliteLogDb != 0 && (bero==5 || !logHoleCardsDone)) {
// sqlite-db is open and we are in postriver or before postriver doesn't log hole cards til now
PlayerListConstIterator it_c;
int myCards[2];
PlayerListConstIterator it_c;
int myCards[2];
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
(*it_c)->getMyCards(myCards);
sql += "UPDATE Hand SET ";
if(bero==5) {
sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_text=\"" + CardsValue::determineHandName((*it_c)->getMyCardsValueInt(),activePlayerList) + "\"";
sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_int=" + boost::lexical_cast<string>((*it_c)->getMyCardsValueInt());
}
if(bero==5 && !logHoleCardsDone) {
sql+= ",";
}
if(!logHoleCardsDone) {
sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_1=" + boost::lexical_cast<string>(myCards[0]);
sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_2=" + boost::lexical_cast<string>(myCards[1]);
}
sql += " WHERE ";
sql += "GameID=" + boost::lexical_cast<string>(curGameID) + " AND ";
sql += "HandID=" + boost::lexical_cast<string>(curHandID);
sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
(*it_c)->getMyCards(myCards);
sql += "UPDATE Hand SET ";
if(bero==5) {
sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_text=\"" + CardsValue::determineHandName((*it_c)->getMyCardsValueInt(),activePlayerList) + "\"";
sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_int=" + boost::lexical_cast<string>((*it_c)->getMyCardsValueInt());
}
if(bero==5 && !logHoleCardsDone) {
sql+= ",";
}
if(!logHoleCardsDone) {
sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_1=" + boost::lexical_cast<string>(myCards[0]);
sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_2=" + boost::lexical_cast<string>(myCards[1]);
}
sql += " WHERE ";
sql += "GameID=" + boost::lexical_cast<string>(curGameID) + " AND ";
sql += "HandID=" + boost::lexical_cast<string>(curHandID);
sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql);
}
if(!logHoleCardsDone) {
logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_SHOW);
} else {
logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_HAS);
}
}
}
if(!logHoleCardsDone) {
logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_SHOW);
} else {
logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_HAS);
}
}
}
logHoleCardsDone = true;
logHoleCardsDone = true;
}
}
}
@@ -430,16 +429,16 @@ void Log::logHoleCardsHandName(int bero, PlayerList activePlayerList)
void Log::exec_transaction(string *sql)
{
char *errmsg = NULL;
char *errmsg = NULL;
string sql_transaction = "BEGIN;" + *sql + "COMMIT;";
*sql = "";
string sql_transaction = "BEGIN;" + *sql + "COMMIT;";
*sql = "";
if(sqlite3_exec(mySqliteLogDb, sql_transaction.data(), 0, 0, &errmsg) != SQLITE_OK) {
cout << "Error in statement: " << sql_transaction.data() << "[" << errmsg << "]." << endl;
sqlite3_free(errmsg);
errmsg = NULL;
}
if(sqlite3_exec(mySqliteLogDb, sql_transaction.data(), 0, 0, &errmsg) != SQLITE_OK) {
cout << "Error in statement: " << sql_transaction.data() << "[" << errmsg << "]." << endl;
sqlite3_free(errmsg);
errmsg = NULL;
}
}
//void
+6 -6
View File
@@ -30,7 +30,7 @@ class Log
{
public:
Log(ConfigFile *c);
Log(ConfigFile *c);
~Log();
@@ -38,18 +38,18 @@ public:
void logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned smallBlindPosition, int bigBlind, unsigned bigBlindPosition, PlayerList seatsList);
void logPlayerAction(int bero, int seat, PlayerActionLog action, int amount = 0);
void logBoardCards(int bero, int boardCards[5]);
void logHoleCardsHandName(int bero, PlayerList activePlayerList);
void exec_transaction(std::string *sql);
void logHoleCardsHandName(int bero, PlayerList activePlayerList);
void exec_transaction(std::string *sql);
// void closeLogDbAtExit();
private:
sqlite3 *mySqliteLogDb;
ConfigFile *myConfig;
ConfigFile *myConfig;
int curGameID;
int curHandID;
std::string sql;
bool logHoleCardsDone;
std::string sql;
bool logHoleCardsDone;
};
#endif // LOG_H
+1 -1
View File
@@ -30,7 +30,7 @@ class HandInterface;
class ClientBeRo : public BeRoInterface
{
public:
ClientBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
ClientBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
~ClientBeRo();
GameState getMyBeRoID() const;
+2 -2
View File
@@ -24,7 +24,7 @@
using namespace std;
ClientBoard::ClientBoard(unsigned dp)
: pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0)
: pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0)
{
myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0;
}
@@ -98,7 +98,7 @@ void
ClientBoard::setLastActionPlayerID(unsigned theValue)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
lastActionPlayerID = theValue;
lastActionPlayerID = theValue;
}
void
+2 -2
View File
@@ -45,7 +45,7 @@ public:
void setSets(int theValue);
void setAllInCondition(bool theValue);
void setLastActionPlayerID(unsigned theValue);
void setLastActionPlayerID(unsigned theValue);
void collectSets();
void collectPot();
@@ -74,7 +74,7 @@ private:
int sets;
unsigned dealerPosition;
bool allInCondition;
unsigned lastActionPlayerID;
unsigned lastActionPlayerID;
};
#endif
@@ -58,11 +58,11 @@ ClientEngineFactory::createBeRo(HandInterface *hi, unsigned dP, int sB)
{
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_PREFLOP)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_FLOP)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_TURN)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_RIVER)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_POST_RIVER)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_PREFLOP)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_FLOP)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_TURN)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_RIVER)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_POST_RIVER)));
return myBeRo;
@@ -41,7 +41,7 @@ public:
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
};
#endif
+7 -7
View File
@@ -22,8 +22,8 @@
using namespace std;
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(GAME_STATE_PREFLOP),
smallBlind(sB), startCash(sC), previousPlayerID(-1), allInCondition(0),
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(GAME_STATE_PREFLOP),
smallBlind(sB), startCash(sC), previousPlayerID(-1), allInCondition(0),
cardsShown(false), bettingRoundsPlayed(0)
{
PlayerListIterator it;
@@ -51,7 +51,7 @@ ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boos
// the rest of the buttons are assigned later as received from the server.
// Preflop, Flop, Turn und River erstellen
myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind);
myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind);
}
@@ -290,28 +290,28 @@ void
ClientHand::setPreviousPlayerID(int theValue)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
previousPlayerID = theValue;
previousPlayerID = theValue;
}
int
ClientHand::getPreviousPlayerID() const
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return previousPlayerID;
return previousPlayerID;
}
void
ClientHand::setLastActionPlayerID (unsigned theValue)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
lastActionPlayerID = theValue;
lastActionPlayerID = theValue;
}
unsigned
ClientHand::getLastActionPlayerID() const
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return lastActionPlayerID;
return lastActionPlayerID;
}
void
+9 -9
View File
@@ -63,8 +63,8 @@ public:
void setStartQuantityPlayers ( int theValue );
int getStartQuantityPlayers() const;
void setCurrentRound ( GameState theValue );
GameState getCurrentRound() const;
void setCurrentRound ( GameState theValue );
GameState getCurrentRound() const;
void setDealerPosition ( int theValue );
int getDealerPosition() const;
@@ -81,11 +81,11 @@ public:
void setBettingRoundsPlayed ( int theValue );
int getBettingRoundsPlayed() const;
void setPreviousPlayerID ( int theValue );
int getPreviousPlayerID() const;
void setPreviousPlayerID ( int theValue );
int getPreviousPlayerID() const;
void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayerID() const;
void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayerID() const;
void setCardsShown ( bool theValue );
bool getCardsShown() const;
@@ -115,12 +115,12 @@ private:
int myID;
int startQuantityPlayers;
unsigned dealerPosition;
GameState currentRound;
GameState currentRound;
int smallBlind;
int startCash;
int previousPlayerID;
unsigned lastActionPlayerID;
int previousPlayerID;
unsigned lastActionPlayerID;
bool allInCondition;
bool cardsShown;
+1 -1
View File
@@ -25,7 +25,7 @@ using namespace std;
ClientPlayer::ClientPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type),
myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0),
myAction(PLAYER_ACTION_NONE), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(true), myTurn(false), myCardsFlip(false), myRoundStartCash(0),
myAction(PLAYER_ACTION_NONE), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(true), myTurn(false), myCardsFlip(false), myRoundStartCash(0),
lastMoneyWon(0), sBluff(0), sBluffStatus(false), myWinnerState(false), m_isConnected(false)
{
myBestHandPosition[0] = myBestHandPosition[1] = myBestHandPosition[2] = myBestHandPosition[3] = myBestHandPosition[4] = 0;
+3 -3
View File
@@ -64,8 +64,8 @@ public:
int getMySet() const;
int getMyLastRelativeSet() const;
void setMyAction(PlayerAction theValue, bool blind);
PlayerAction getMyAction() const;
void setMyAction(PlayerAction theValue, bool blind);
PlayerAction getMyAction() const;
void setMyButton(int theValue);
int getMyButton() const;
@@ -172,7 +172,7 @@ private:
int myCash;
int mySet;
int myLastRelativeSet;
PlayerAction myAction;
PlayerAction myAction;
int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big
bool myActiveStatus; // 0 = inactive, 1 = active
bool myStayOnTableStatus; // 0 = left, 1 = stay
+2 -2
View File
@@ -62,8 +62,8 @@ public:
virtual int getMySet() const =0;
virtual int getMyLastRelativeSet() const =0;
virtual void setMyAction(PlayerAction theValue, bool blind=0) =0;
virtual PlayerAction getMyAction() const =0;
virtual void setMyAction(PlayerAction theValue, bool blind=0) =0;
virtual PlayerAction getMyAction() const =0;
virtual void setMyButton(int theValue) =0;
virtual int getMyButton() const =0;