diff --git a/src/engine/local_engine/cardsvalue.cpp b/src/engine/local_engine/cardsvalue.cpp index 1e808de6..bc9670fb 100755 --- a/src/engine/local_engine/cardsvalue.cpp +++ b/src/engine/local_engine/cardsvalue.cpp @@ -30,7 +30,7 @@ CardsValue::~CardsValue() { } -int CardsValue::holeCardsClass(int one, int two) { +int CardsValue::holeCardsClass(int one, int two) const { if((one-1)%13<(two-1)%13) { int temp = one; @@ -166,7 +166,7 @@ int CardsValue::holeCardsClass(int one, int two) { } -int CardsValue::holeCardsToIntCode(int* cards) { +int CardsValue::holeCardsToIntCode(int* cards) const { // Code der HoleCards ermitteln if(cards[0]%13 == cards[1]%13) { @@ -189,7 +189,7 @@ int CardsValue::holeCardsToIntCode(int* cards) { } -int* intCodeToHoleCards(int code) { +int* CardsValue::intCodeToHoleCards(int code) const { // one possibility !!! @@ -207,7 +207,7 @@ int* intCodeToHoleCards(int code) { } -int CardsValue::cardsValue(int* cards, int* position) { +int CardsValue::cardsValue(int* cards, int* position) const { int array[7][3]; int j1, j2, j3, j4, j5, k1, k2, ktemp[3]; @@ -586,7 +586,7 @@ int array[7][3]; } -vector< vector > CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardCards) +vector< vector > CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardCards) const { int i,j; diff --git a/src/engine/local_engine/cardsvalue.h b/src/engine/local_engine/cardsvalue.h index 9006a832..646090d5 100755 --- a/src/engine/local_engine/cardsvalue.h +++ b/src/engine/local_engine/cardsvalue.h @@ -34,13 +34,13 @@ public: ~CardsValue(); - int holeCardsClass(int, int); - int cardsValue(int*, int*); + int holeCardsClass(int, int) const; + int cardsValue(int*, int*) const; - int holeCardsToIntCode(int*); - int* intCodeToHoleCards(int); + int holeCardsToIntCode(int*) const; + int* intCodeToHoleCards(int) const; - std::vector< std::vector > calcCardsChance(GameState, int*, int*); + std::vector< std::vector > calcCardsChance(GameState, int*, int*) const; //int** showdown(GameState, int**, int); }; diff --git a/src/engine/local_engine/localbero.cpp b/src/engine/local_engine/localbero.cpp index 2c6a4acd..782e784b 100644 --- a/src/engine/local_engine/localbero.cpp +++ b/src/engine/local_engine/localbero.cpp @@ -95,7 +95,6 @@ void LocalBeRo::run() { if(!(myHand->getAllInCondition())) { PlayerListIterator it_1, it_2; - size_t i; // running player before smallBlind bool formerRunningPlayerFound = false; @@ -106,7 +105,7 @@ void LocalBeRo::run() { throw LocalException(__FILE__, __LINE__, ERR_ACTIVE_PLAYER_NOT_FOUND); } - for(i=0; igetActivePlayerList()->size(); i++) { + for(size_t i=0; igetActivePlayerList()->size(); i++) { if(it_1 == myHand->getActivePlayerList()->begin()) it_1 = myHand->getActivePlayerList()->end(); it_1--; @@ -165,8 +164,6 @@ void LocalBeRo::run() { } } - int i; - // prfen, ob aktuelle bero wirklich dran ist if(!firstRound && allHighestSet) { @@ -186,7 +183,7 @@ void LocalBeRo::run() { myHand->getGuiInterface()->refreshSet(); myHand->getGuiInterface()->refreshCash(); - for(i=0; igetGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); } + for(int i=0; igetGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); } myHand->switchRounds(); } diff --git a/src/engine/local_engine/localberopreflop.cpp b/src/engine/local_engine/localberopreflop.cpp index 4e2ead3d..f5403730 100644 --- a/src/engine/local_engine/localberopreflop.cpp +++ b/src/engine/local_engine/localberopreflop.cpp @@ -110,7 +110,6 @@ void LocalBeRoPreflop::run() { } - int i; bool allHighestSet = true; PlayerListConstIterator it_c; @@ -152,7 +151,7 @@ void LocalBeRoPreflop::run() { getMyHand()->getGuiInterface()->refreshSet(); getMyHand()->getGuiInterface()->refreshCash(); - for(i=0; igetGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); } + for(int i=0; igetGuiInterface()->refreshAction(i,PLAYER_ACTION_NONE); } getMyHand()->switchRounds(); } diff --git a/src/engine/local_engine/localboard.cpp b/src/engine/local_engine/localboard.cpp index ec8d19d5..692879ed 100755 --- a/src/engine/local_engine/localboard.cpp +++ b/src/engine/local_engine/localboard.cpp @@ -29,6 +29,7 @@ using namespace std; LocalBoard::LocalBoard() : BoardInterface(), currentHand(0), pot(0), sets(0) { + myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; } LocalBoard::~LocalBoard() @@ -230,11 +231,11 @@ void LocalBoard::distributePot() { if(pot!=0) LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: Pot = " << pot); - int sum = 0; + /*int sum = 0; for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) { sum += (*it_c)->getMyCash(); - } + }*/ } void LocalBoard::determinePlayerNeedToShowCards() { diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 9575e542..5e08421e 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -4421,7 +4421,6 @@ void LocalPlayer::preflopEngine3() { // cout << "nextID " << currentHand->getPlayerArray()[(myID+1)%5]->getMyID() << endl; - int raise = 0; // Bauchgefhl (zufᅵlig) int tempRand; @@ -4450,7 +4449,8 @@ void LocalPlayer::preflopEngine3() { else { // RAISE --> wenn hohes Potential if((potential >= 4 && 6 * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || bluff <= 6) { - // extrem hohes Potential --> groᅵr Raise + int raise = 0; + // extrem hohes Potential --> groᅵr Raise if(potential>=6 || bluff <= 2) { // bluff - raise @@ -4654,8 +4654,6 @@ void LocalPlayer::flopEngine3() { double percent = (countMy*1.0)/(countAll*1.0); // cout << "Prozent: " << percent << endl; - int raise = 0; - // Bauchgefhl (zufᅵlig) int tempRand; Tools::getRandNumber((int)(percent*10.)-2,(int)(percent*10.)+2,1,&tempRand,0); @@ -4718,7 +4716,9 @@ void LocalPlayer::flopEngine3() { // RAISE --> wenn Potential besonders gut if((potential >=4 && 2 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || (bluff <= 5 && 4 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet())) { - // bluff - raise + int raise = 0; + + // bluff - raise if(bluff <=5) raise = ((bluff+1)/2) * currentHand->getCurrentBeRo()->getHighestSet(); // Betrag, der ber dem aktuell HighestSet gesetzt werden soll else raise = ((potential - 2 ) / 2) * currentHand->getCurrentBeRo()->getHighestSet(); @@ -4820,8 +4820,6 @@ void LocalPlayer::turnEngine3() { double percent = (countMy*1.0)/(countAll*1.0); // cout << "Prozent: " << percent << endl; - int raise; - // Bauchgefhl (zufᅵlig) int tempRand; Tools::getRandNumber((int)(percent*10.)-2,(int)(percent*10.)+2,1,&tempRand,0); @@ -4886,7 +4884,9 @@ void LocalPlayer::turnEngine3() { // RAISE --> wenn Potential besonders gut if((potential >=4 && 2 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || (bluff <= 4 && 3 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet())) { - // bluff - raise + int raise = 0; + + // bluff - raise if(bluff <= 4) raise = ((bluff+1)/2) * currentHand->getCurrentBeRo()->getHighestSet(); // Betrag, der ber dem aktuell HighestSet gesetzt werden soll else raise = ( potential - 3 ) * currentHand->getCurrentBeRo()->getHighestSet(); @@ -4982,8 +4982,6 @@ void LocalPlayer::riverEngine3() { double percent = (countMy*1.0)/(countAll*1.0); // cout << "Prozent: " << percent << endl; - int raise; - // Bauchgefhl (zufᅵlig) int tempRand; Tools::getRandNumber((int)(percent*10.)-2,(int)(percent*10.)+2,1,&tempRand,0); @@ -5048,7 +5046,9 @@ void LocalPlayer::riverEngine3() { // RAISE --> wenn Potential besonders gut if((potential >=4 && 2 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || (bluff <= 2 && 4 * tempFold * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet())) { - // bluff - raise + int raise = 0; + + // bluff - raise if(bluff <= 2 ) raise = bluff * currentHand->getCurrentBeRo()->getHighestSet(); // Betrag, der ber dem aktuell HighestSet gesetzt werden soll else raise = ( potential - 3 ) * currentHand->getCurrentBeRo()->getHighestSet(); diff --git a/src/engine/network_engine/clientbero.cpp b/src/engine/network_engine/clientbero.cpp index e8bcdadc..dbaa9d64 100644 --- a/src/engine/network_engine/clientbero.cpp +++ b/src/engine/network_engine/clientbero.cpp @@ -20,7 +20,9 @@ #include "clientbero.h" ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, unsigned /*dP*/, int sB, GameState gS) -: BeRoInterface(), myBeRoID(gS), myHand(hi), highestCardsValue(0), highestSet(0), firstRound(true), smallBlindPosition(0), smallBlind(sB), minimumRaise(0), fullBetRule(false) +: BeRoInterface(), myBeRoID(gS), myHand(hi), highestCardsValue(0), smallBlindPositionId(0), bigBlindPositionId(0), currentPlayersTurnId(0), + firstRoundLastPlayersTurnId(0), highestSet(0), firstRound(true), smallBlindPosition(0), smallBlind(sB), minimumRaise(2*sB), fullBetRule(false), + lastActionPlayer(0) { } diff --git a/src/engine/network_engine/clientboard.cpp b/src/engine/network_engine/clientboard.cpp index a1ec1d58..9dc882d2 100644 --- a/src/engine/network_engine/clientboard.cpp +++ b/src/engine/network_engine/clientboard.cpp @@ -26,6 +26,7 @@ using namespace std; ClientBoard::ClientBoard() : currentHand(0), pot(0), sets(0) { + myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; } diff --git a/src/engine/network_engine/clientplayer.cpp b/src/engine/network_engine/clientplayer.cpp index 03960a27..445fd03b 100644 --- a/src/engine/network_engine/clientplayer.cpp +++ b/src/engine/network_engine/clientplayer.cpp @@ -23,8 +23,16 @@ using namespace std; ClientPlayer::ClientPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) -: PlayerInterface(), myConfig(c), currentHand(0), currentBoard(b), myCardsValue(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(0), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(1), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0) +: PlayerInterface(), myConfig(c), currentHand(0), currentBoard(b), myCardsValue(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(0), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(true), myTurn(false), myCardsFlip(false), myRoundStartCash(0), + lastMoneyWon(0), sBluff(0), sBluffStatus(false), myWinnerState(false) { + myBestHandPosition[0] = myBestHandPosition[1] = myBestHandPosition[2] = myBestHandPosition[3] = myBestHandPosition[4] = 0; + myNiveau[0] = myNiveau[1] = myNiveau[2] = 0; + myCards[0] = myCards[1] = 0; + myAverageSets[0] = myAverageSets[1] = myAverageSets[2] = myAverageSets[3] = 0; + myAggressive[0] = myAggressive[1] = myAggressive[2] = myAggressive[3] = myAggressive[4] = myAggressive[5] = myAggressive[6] = false; } diff --git a/src/gui/qt/styles/gametablestylereader.cpp b/src/gui/qt/styles/gametablestylereader.cpp index ce103fdf..d29d334d 100644 --- a/src/gui/qt/styles/gametablestylereader.cpp +++ b/src/gui/qt/styles/gametablestylereader.cpp @@ -22,7 +22,8 @@ using namespace std; -GameTableStyleReader::GameTableStyleReader(ConfigFile *c, QWidget *w) : myConfig(c), myW(w), fallBack(0), loadedSuccessfull(0) +GameTableStyleReader::GameTableStyleReader(ConfigFile *c, QWidget *w) +: myConfig(c), myW(w), fallBack(0), loadedSuccessfull(0), myState(GT_STYLE_UNDEFINED) { //set fonts and font sizes diff --git a/src/gui/qt/styles/gametablestylereader.h b/src/gui/qt/styles/gametablestylereader.h index 38b086b7..b6426a7c 100644 --- a/src/gui/qt/styles/gametablestylereader.h +++ b/src/gui/qt/styles/gametablestylereader.h @@ -36,6 +36,7 @@ enum GtStyleState { GT_STYLE_OUTDATED, GT_STYLE_FIELDS_EMPTY, GT_STYLE_PICTURES_MISSING, + GT_STYLE_UNDEFINED }; class gameTableImpl;