From 2f04eeb245e596cceef93e24ac01bb80b615dd59 Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 8 Aug 2007 00:17:31 +0000 Subject: [PATCH] BeRo refactoring --- src/engine/local_engine/localbero.cpp | 2 - src/engine/local_engine/localberopreflop.cpp | 4 - src/engine/local_engine/localplayer.cpp | 293 +++++++++---------- src/gui/qt/mainwindow/mainwindowimpl.cpp | 101 ++----- 4 files changed, 165 insertions(+), 235 deletions(-) diff --git a/src/engine/local_engine/localbero.cpp b/src/engine/local_engine/localbero.cpp index 7402c5ce..660ae913 100644 --- a/src/engine/local_engine/localbero.cpp +++ b/src/engine/local_engine/localbero.cpp @@ -39,8 +39,6 @@ void LocalBeRo::nextPlayer() { void LocalBeRo::run() { - cout << "LocalBeRoRun-" << myBeRoID << endl; - int i; if (firstRun) { diff --git a/src/engine/local_engine/localberopreflop.cpp b/src/engine/local_engine/localberopreflop.cpp index 2c4ff117..ede8838c 100644 --- a/src/engine/local_engine/localberopreflop.cpp +++ b/src/engine/local_engine/localberopreflop.cpp @@ -38,7 +38,6 @@ LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, int qP, int dP, in // // erste Spielernummer fr preflopRun() setzen setPlayersTurn(bigBlindPosition); - cout << "LocalBeroPreflop erstellt - " << getMyBeRoID() << endl; } @@ -52,9 +51,6 @@ LocalBeRoPreflop::~LocalBeRoPreflop() void LocalBeRoPreflop::run() { - cout << "LocalBeroPreflopRun!!!" << endl; - -// cout << "NextPlayerSpeed2 stop" << endl; int i; bool allHighestSet = 1; diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index e7f4e700..6fb3ca38 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -167,7 +167,7 @@ void LocalPlayer::preflopEngine() { myNiveau[2] = 54 + myDude4 - 7*(players - 2); // eigenes mögliches highestSet - int individualHighestSet = actualHand->getPreflop()->getHighestSet(); + int individualHighestSet = actualHand->getCurrentBeRo()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; // Verhaeltnis Set / Cash für call @@ -207,7 +207,7 @@ void LocalPlayer::preflopEngine() { if(myOdds >= myNiveau[2]) { // raise-loop unterbinden -> d.h. entweder call oder bei superblatt all in - if(actualHand->getPreflop()->getHighestSet() >= 12*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 12*actualHand->getSmallBlind()) { // all in if(myOdds >= myNiveau[2] + 8) { raise = myCash; @@ -216,7 +216,7 @@ void LocalPlayer::preflopEngine() { // nur call else { // all in bei knappem call - if(myCash-actualHand->getPreflop()->getHighestSet() <= (myCash*1)/5) { + if(myCash-actualHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { raise = myCash; myAction = 5; } else { @@ -229,8 +229,8 @@ 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->getPreflop()->getHighestSet()) { - raise = actualHand->getPreflop()->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) { @@ -243,33 +243,33 @@ void LocalPlayer::preflopEngine() { if(cBluff > 90) { myAction = 3; // bigBlind --> check - if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; + if(myButton == 3 && mySet == actualHand->getCurrentBeRo()->getHighestSet()) myAction = 2; } if(cBluff > 80 && myOdds >= myNiveau[2] + 4) { myAction = 3; // bigBlind --> check - if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; + if(myButton == 3 && mySet == actualHand->getCurrentBeRo()->getHighestSet()) myAction = 2; } if(cBluff > 70 && myOdds >= myNiveau[2] + 8) { myAction = 3; // bigBlind --> check - if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; + if(myButton == 3 && mySet == actualHand->getCurrentBeRo()->getHighestSet()) myAction = 2; } if(cBluff > 60 && myOdds >= myNiveau[2] + 12) { myAction = 3; // bigBlind --> check - if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; + if(myButton == 3 && mySet == actualHand->getCurrentBeRo()->getHighestSet()) myAction = 2; } } else { // call - if(myOdds >= myNiveau[0] || (mySet >= actualHand->getPreflop()->getHighestSet()/2 && myOdds >= myNiveau[0]-8)) { + if(myOdds >= myNiveau[0] || (mySet >= actualHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-8)) { // bigBlind --> check - if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; + if(myButton == 3 && mySet == actualHand->getCurrentBeRo()->getHighestSet()) myAction = 2; else { // all in bei knappem call - if(myCash-actualHand->getPreflop()->getHighestSet() <= (myCash*1)/5) { + if(myCash-actualHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { raise = myCash; myAction = 5; } @@ -281,7 +281,7 @@ void LocalPlayer::preflopEngine() { // fold else { // bigBlind -> check - if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; + if(myButton == 3 && mySet == actualHand->getCurrentBeRo()->getHighestSet()) myAction = 2; else myAction = 1; } } @@ -289,22 +289,22 @@ void LocalPlayer::preflopEngine() { // cout << sBluff << endl; // auf sBluff testen --> raise statt call oder fold - if((sBluff < 100/(((actualHand->getActualQuantityPlayers()-2)*6)+3) && myOdds < myNiveau[2] && actualHand->getPreflop()->getHighestSet() == 2*actualHand->getSmallBlind() && sBluffStatus == 0) || sBluffStatus == 1) { + if((sBluff < 100/(((actualHand->getActualQuantityPlayers()-2)*6)+3) && myOdds < myNiveau[2] && actualHand->getCurrentBeRo()->getHighestSet() == 2*actualHand->getSmallBlind() && sBluffStatus == 0) || sBluffStatus == 1) { // cout << "sBLUFF!" << endl; sBluffStatus = 1; // Gegner raisen ebenfalls -> call - if(actualHand->getPreflop()->getHighestSet() >= 4*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 4*actualHand->getSmallBlind()) { // all in bei knappem call - if(myCash-actualHand->getPreflop()->getHighestSet() <= (myCash*1)/6) { + if(myCash-actualHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/6) { raise = myCash; myAction = 5; } else { myAction = 3; // bigBlind --> check - if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; + if(myButton == 3 && mySet == actualHand->getCurrentBeRo()->getHighestSet()) myAction = 2; } } // Standard-Raise-Routine @@ -312,8 +312,8 @@ void LocalPlayer::preflopEngine() { // raise-Betrag ermitteln raise = (sBluff/(8-actualHand->getActualQuantityPlayers()))*actualHand->getSmallBlind(); // raise-Betrag zu klein -> mindestens Standard-raise - if(raise < actualHand->getPreflop()->getHighestSet()) { - raise = actualHand->getPreflop()->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) { @@ -323,7 +323,7 @@ void LocalPlayer::preflopEngine() { } // extrem hoher set der gegner -> bluff beenden - if((actualHand->getPreflop()->getHighestSet() >= 12*actualHand->getSmallBlind() && myOdds < myNiveau[0]) || (actualHand->getPreflop()->getHighestSet() >= 20*actualHand->getSmallBlind() && myOdds < myNiveau[2])) { + if((actualHand->getCurrentBeRo()->getHighestSet() >= 12*actualHand->getSmallBlind() && myOdds < myNiveau[0]) || (actualHand->getCurrentBeRo()->getHighestSet() >= 20*actualHand->getSmallBlind() && myOdds < myNiveau[2])) { myAction = 1; } @@ -360,7 +360,7 @@ void LocalPlayer::flopEngine() { myNiveau[2] = 69 + myDude4 - 7*(players - 2); // eigenes mögliches highestSet - int individualHighestSet = actualHand->getFlop()->getHighestSet(); + int individualHighestSet = actualHand->getCurrentBeRo()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; // Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist @@ -376,7 +376,7 @@ void LocalPlayer::flopEngine() { Tools::getRandNumber(1,100,1,&cBluff,0); // aktiv oder passiv? - if(actualHand->getFlop()->getHighestSet() > 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // Verhaeltnis Set / Cash für call if(myCash/individualHighestSet >= 25) { @@ -394,7 +394,7 @@ void LocalPlayer::flopEngine() { if(myOdds >= myNiveau[2]) { // raise-loop unterbinden -> d.h. entweder call oder bei superblatt all in - if(actualHand->getFlop()->getHighestSet() >= 12*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 12*actualHand->getSmallBlind()) { // all in if(myOdds >= myNiveau[2] + 15) { raise = myCash; @@ -403,7 +403,7 @@ void LocalPlayer::flopEngine() { // nur call else { // all in bei knappem call - if(myCash-actualHand->getFlop()->getHighestSet() <= (myCash*1)/5) { + if(myCash-actualHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { raise = myCash; myAction = 5; } else { @@ -416,8 +416,8 @@ 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->getFlop()->getHighestSet()) { - raise = actualHand->getFlop()->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) { @@ -435,9 +435,9 @@ void LocalPlayer::flopEngine() { } else { // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt - if(myOdds >= myNiveau[0] || (mySet >= actualHand->getFlop()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { + if(myOdds >= myNiveau[0] || (mySet >= actualHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { // all in bei knappem call - if(actualHand->getFlop()->getHighestSet() > (myCash*3.0)/4.0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) { raise = myCash; myAction = 5; } @@ -504,14 +504,14 @@ void LocalPlayer::flopEngine() { // auf sBluffStatus testen --> raise statt call und bet statt check // aktiv oder passiv? - if(actualHand->getFlop()->getHighestSet() > 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { if(sBluffStatus && myOdds < myNiveau[2]) { // cout << "sBLUFF!" << endl; // Gegner setzen -> call - if(actualHand->getFlop()->getHighestSet() >= 4*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 4*actualHand->getSmallBlind()) { myAction = 3; } // Standard-Raise-Routine @@ -520,8 +520,8 @@ void LocalPlayer::flopEngine() { Tools::getRandNumber(1,8,1,&rand,0); raise = rand*actualHand->getSmallBlind(); // raise-Betrag zu klein -> mindestens Standard-raise - if(raise < actualHand->getFlop()->getHighestSet()) { - raise = actualHand->getFlop()->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) { @@ -531,7 +531,7 @@ void LocalPlayer::flopEngine() { } // extrem hoher set der gegner -> bluff beenden - if(actualHand->getFlop()->getHighestSet() >= 10*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 10*actualHand->getSmallBlind()) { myAction = 1; } } @@ -595,7 +595,7 @@ void LocalPlayer::flopEngine() { // flopCardsValue(tempArray); // // // aktive Situation --> check / bet -// if(actualHand->getFlop()->getHighestSet() == 0) { +// if(actualHand->getCurrentBeRo()->getHighestSet() == 0) { // // switch(info[0]) { // case 9: {} @@ -861,14 +861,14 @@ void LocalPlayer::turnEngine() { // eigenes mögliches highestSet - int individualHighestSet = actualHand->getTurn()->getHighestSet(); + int individualHighestSet = actualHand->getCurrentBeRo()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; // Check-Bluff generieren Tools::getRandNumber(1,100,1,&cBluff,0); // aktiv oder passiv? - if(actualHand->getTurn()->getHighestSet() > 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // Verhaeltnis Set / Cash if(myCash/individualHighestSet >= 25) { @@ -886,7 +886,7 @@ void LocalPlayer::turnEngine() { if(myOdds >= myNiveau[2]) { // raise-loop unterbinden -> d.h. entweder call oder bei superblatt all in - if(actualHand->getTurn()->getHighestSet() >= 12*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 12*actualHand->getSmallBlind()) { // all in if(myOdds >= myNiveau[2] + 15) { raise = myCash; @@ -895,7 +895,7 @@ void LocalPlayer::turnEngine() { // nur call else { // all in bei knappem call - if(myCash-actualHand->getTurn()->getHighestSet() <= (myCash*1)/5) { + if(myCash-actualHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { raise = myCash; myAction = 5; } else { @@ -908,8 +908,8 @@ 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->getTurn()->getHighestSet()) { - raise = actualHand->getTurn()->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) { @@ -925,9 +925,9 @@ void LocalPlayer::turnEngine() { } else { // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt - if(myOdds >= myNiveau[0] || (mySet >= actualHand->getTurn()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { + if(myOdds >= myNiveau[0] || (mySet >= actualHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { // all in bei knappem call - if(actualHand->getTurn()->getHighestSet() > (myCash*3.0)/4.0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) { raise = myCash; myAction = 5; } @@ -993,14 +993,14 @@ void LocalPlayer::turnEngine() { // auf sBluffStatus testen --> raise statt call und bet statt check // aktiv oder passiv? - if(actualHand->getTurn()->getHighestSet() > 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { if(sBluffStatus && myOdds < myNiveau[2]) { // cout << "sBLUFF!" << endl; // Gegner setzen -> call - if(actualHand->getTurn()->getHighestSet() >= 4*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 4*actualHand->getSmallBlind()) { myAction = 3; } // Standard-Raise-Routine @@ -1009,8 +1009,8 @@ void LocalPlayer::turnEngine() { Tools::getRandNumber(1,8,1,&rand,0); raise = rand*actualHand->getSmallBlind(); // raise-Betrag zu klein -> mindestens Standard-raise - if(raise < actualHand->getTurn()->getHighestSet()) { - raise = actualHand->getTurn()->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) { @@ -1020,7 +1020,7 @@ void LocalPlayer::turnEngine() { } // extrem hoher set der gegner -> bluff beenden - if(actualHand->getTurn()->getHighestSet() >= 10*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 10*actualHand->getSmallBlind()) { myAction = 1; } } @@ -1104,11 +1104,11 @@ void LocalPlayer::riverEngine() { // cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; // eigenes mögliches highestSet - int individualHighestSet = actualHand->getRiver()->getHighestSet(); + int individualHighestSet = actualHand->getCurrentBeRo()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; // aktiv oder passiv? - if(actualHand->getRiver()->getHighestSet() > 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { // Verhaeltnis Set / Cash if(myCash/individualHighestSet >= 25) { @@ -1125,7 +1125,7 @@ void LocalPlayer::riverEngine() { // raise (bei hohem Niveau) if(myOdds >= myNiveau[2]) { // raise-loop unterbinden -> d.h. entweder call oder bei superblatt all in - if(actualHand->getRiver()->getHighestSet() >= 12*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 12*actualHand->getSmallBlind()) { // all in if(myOdds >= myNiveau[2] + 15) { raise = myCash; @@ -1134,7 +1134,7 @@ void LocalPlayer::riverEngine() { // nur call else { // all in bei knappem call - if(myCash-actualHand->getRiver()->getHighestSet() <= (myCash*1)/5) { + if(myCash-actualHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { raise = myCash; myAction = 5; } else { @@ -1147,8 +1147,8 @@ 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->getRiver()->getHighestSet()) { - raise = actualHand->getRiver()->getHighestSet(); + if(raise < actualHand->getCurrentBeRo()->getHighestSet()) { + raise = actualHand->getCurrentBeRo()->getHighestSet(); } // all in bei nur wenigen Chips if(myCash/(2*actualHand->getSmallBlind()) <= 8) { @@ -1159,9 +1159,9 @@ void LocalPlayer::riverEngine() { } else { // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt - if(myOdds >= myNiveau[0] || (mySet >= actualHand->getRiver()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { + if(myOdds >= myNiveau[0] || (mySet >= actualHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { // all in bei knappem call - if(myCash-actualHand->getRiver()->getHighestSet() <= (myCash*1)/4) { + if(myCash-actualHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/4) { raise = myCash; myAction = 5; } @@ -1220,14 +1220,14 @@ void LocalPlayer::riverEngine() { // auf sBluffStatus testen --> raise statt call und bet statt check // aktiv oder passiv? - if(actualHand->getRiver()->getHighestSet() > 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() > 0) { if(sBluffStatus && myOdds < myNiveau[2]) { // cout << "sBLUFF!" << endl; // Gegner setzen -> call - if(actualHand->getRiver()->getHighestSet() >= 4*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 4*actualHand->getSmallBlind()) { myAction = 3; } // Standard-Raise-Routine @@ -1236,8 +1236,8 @@ void LocalPlayer::riverEngine() { Tools::getRandNumber(1,8,1,&rand,0); raise = rand*actualHand->getSmallBlind(); // raise-Betrag zu klein -> mindestens Standard-raise - if(raise < actualHand->getRiver()->getHighestSet()) { - raise = actualHand->getRiver()->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) { @@ -1247,7 +1247,7 @@ void LocalPlayer::riverEngine() { } // extrem hoher set der gegner -> bluff beenden - if(actualHand->getRiver()->getHighestSet() >= 10*actualHand->getSmallBlind()) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= 10*actualHand->getSmallBlind()) { myAction = 1; } } @@ -1290,17 +1290,7 @@ void LocalPlayer::evaluation(int bet, int raise) { int highestSet = 0; - switch(actualHand->getActualRound()) { - case 0: highestSet = actualHand->getPreflop()->getHighestSet(); - break; - case 1: highestSet = actualHand->getFlop()->getHighestSet(); - break; - case 2: highestSet = actualHand->getTurn()->getHighestSet(); - break; - case 3: highestSet = actualHand->getRiver()->getHighestSet(); - break; - default: cout << "ERROR - wrong init of actualRound" << endl; - } + highestSet = actualHand->getCurrentBeRo()->getHighestSet(); // cout << "myAction(evaluation): " << myAction << endl; switch(myAction) { @@ -1374,19 +1364,8 @@ void LocalPlayer::evaluation(int bet, int raise) { // cout << "highestSet(ende evaluation): " << highestSet << endl; - switch(actualHand->getActualRound()) { - case 0: actualHand->getPreflop()->setHighestSet(highestSet); - break; - case 1: actualHand->getFlop()->setHighestSet(highestSet); - break; - case 2: actualHand->getTurn()->setHighestSet(highestSet); - break; - case 3: actualHand->getRiver()->setHighestSet(highestSet); - break; - default: cout << "ERROR - wrong init of actualRound" << endl; - } - - + actualHand->getCurrentBeRo()->setHighestSet(highestSet); + } @@ -2562,7 +2541,7 @@ void LocalPlayer::preflopEngine3() { // Potential int potential = 10*(4*(myCardsValue->holeCardsClass(myCards[0], myCards[1]))+1*tempRand)/50-myDude; - int setToHighest = actualHand->getPreflop()->getHighestSet() - mySet; + int setToHighest = actualHand->getCurrentBeRo()->getHighestSet() - mySet; // temp fr das Vielfache des Small Blind, sodass HighestSet zu hoch ist int tempFold; @@ -2575,19 +2554,19 @@ void LocalPlayer::preflopEngine3() { } else { // RAISE --> wenn hohes Potential - if(potential >= 4 && 6 * actualHand->getSmallBlind() >= actualHand->getPreflop()->getHighestSet() || bluff <= 6) { + if(potential >= 4 && 6 * actualHand->getSmallBlind() >= actualHand->getCurrentBeRo()->getHighestSet() || bluff <= 6) { // extrem hohes Potential --> groᅵr Raise if(potential>=6 || bluff <= 2) { // bluff - raise - if(bluff <=2 && 4 * actualHand->getSmallBlind() > actualHand->getPreflop()->getHighestSet()) { - raise = 3 * actualHand->getPreflop()->getHighestSet(); + if(bluff <=2 && 4 * actualHand->getSmallBlind() > actualHand->getCurrentBeRo()->getHighestSet()) { + raise = 3 * actualHand->getCurrentBeRo()->getHighestSet(); } else { // bluff - call if(bluff >= 98) { // All In - if(actualHand->getPreflop()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -2596,16 +2575,16 @@ void LocalPlayer::preflopEngine3() { } // sonst else { - myCash = myCash - actualHand->getPreflop()->getHighestSet() + mySet; - mySet = actualHand->getPreflop()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } else { // doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!! - if(! (4 * actualHand->getSmallBlind() > actualHand->getPreflop()->getHighestSet())) { + if(! (4 * actualHand->getSmallBlind() > actualHand->getCurrentBeRo()->getHighestSet())) { // All In - if(actualHand->getPreflop()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -2614,28 +2593,28 @@ void LocalPlayer::preflopEngine3() { } // sonst else { - myCash = myCash - actualHand->getPreflop()->getHighestSet() + mySet; - mySet = actualHand->getPreflop()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } - else raise = (potential - 4 ) * 2 * actualHand->getPreflop()->getHighestSet(); + else raise = (potential - 4 ) * 2 * actualHand->getCurrentBeRo()->getHighestSet(); } } } // hohes Potential --> gemäßigter Raise else { // bluff - raise - if(bluff <= 6 && 4 * actualHand->getSmallBlind() > actualHand->getPreflop()->getHighestSet()) { - raise = 2*actualHand->getPreflop()->getHighestSet(); + if(bluff <= 6 && 4 * actualHand->getSmallBlind() > actualHand->getCurrentBeRo()->getHighestSet()) { + raise = 2*actualHand->getCurrentBeRo()->getHighestSet(); } else { // bluff - call if(bluff >= 93) { // All In - if(actualHand->getPreflop()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -2644,17 +2623,17 @@ void LocalPlayer::preflopEngine3() { } // sonst else { - myCash = myCash - actualHand->getPreflop()->getHighestSet() + mySet; - mySet = actualHand->getPreflop()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } else { // doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!! - if(! (4 * actualHand->getSmallBlind() > actualHand->getPreflop()->getHighestSet())) { + if(! (4 * actualHand->getSmallBlind() > actualHand->getCurrentBeRo()->getHighestSet())) { // All In - if(actualHand->getPreflop()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -2663,32 +2642,32 @@ void LocalPlayer::preflopEngine3() { } // sonst else { - myCash = myCash - actualHand->getPreflop()->getHighestSet() + mySet; - mySet = actualHand->getPreflop()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } - else raise = (potential - 3 ) * actualHand->getPreflop()->getHighestSet(); + else raise = (potential - 3 ) * actualHand->getCurrentBeRo()->getHighestSet(); } } } if (raise > 0) { // All In - if(actualHand->getPreflop()->getHighestSet() + raise >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() + raise >= myCash) { mySet += myCash; myCash = 0; myAction = 6; - if(mySet > actualHand->getPreflop()->getHighestSet()) actualHand->getPreflop()->setHighestSet(mySet); + if(mySet > actualHand->getCurrentBeRo()->getHighestSet()) actualHand->getCurrentBeRo()->setHighestSet(mySet); } // sonst else { - myCash = myCash + mySet - actualHand->getPreflop()->getHighestSet() - raise; - mySet = actualHand->getPreflop()->getHighestSet() + raise; - actualHand->getPreflop()->setHighestSet(mySet); + myCash = myCash + mySet - actualHand->getCurrentBeRo()->getHighestSet() - raise; + mySet = actualHand->getCurrentBeRo()->getHighestSet() + raise; + actualHand->getCurrentBeRo()->setHighestSet(mySet); myAction = 5; } } @@ -2696,13 +2675,13 @@ void LocalPlayer::preflopEngine3() { //CHECK und CALL else { // CHECK --> wenn alle Sets glieich bei BigBlind und nich zu hohem Potential - if(mySet == actualHand->getPreflop()->getHighestSet()) { + if(mySet == actualHand->getCurrentBeRo()->getHighestSet()) { myAction = 2; } // CALL --> bei normalen Potential else { // All In - if(actualHand->getPreflop()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -2711,8 +2690,8 @@ void LocalPlayer::preflopEngine3() { } // sonst else { - myCash = myCash - actualHand->getPreflop()->getHighestSet() + mySet; - mySet = actualHand->getPreflop()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } @@ -2795,7 +2774,7 @@ void LocalPlayer::flopEngine3() { // Potential int potential = (10*(5*(int)(percent*100.)+10*tempRand*2))/700-myDude; - int setToHighest = actualHand->getFlop()->getHighestSet() - mySet; + int setToHighest = actualHand->getCurrentBeRo()->getHighestSet() - mySet; // temp fr das Vielfache des Small Blind, sodass HighestSet zu hoch ist int tempFold; @@ -2808,7 +2787,7 @@ void LocalPlayer::flopEngine3() { } else { // CHECK und BET --> wenn noch keiner was gesetzt hat - if(actualHand->getFlop()->getHighestSet() == 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() == 0) { // CHECK --> wenn Potential klein oder check-bluff sonst bet oder bet-bluff if((potential<3 || bluff >= 80) && bluff > 15) { // check @@ -2835,35 +2814,35 @@ void LocalPlayer::flopEngine3() { myCash -= mySet; myAction = 4; } - actualHand->getFlop()->setHighestSet(mySet); + actualHand->getCurrentBeRo()->setHighestSet(mySet); } } // CALL und RAISE --> wenn bereits gesetzt wurde else { // RAISE --> wenn Potential besonders gut - if((potential >=4 && 2 * tempFold * actualHand->getSmallBlind() >= actualHand->getFlop()->getHighestSet()) || (bluff <= 5 && 4 * tempFold * actualHand->getSmallBlind() >= actualHand->getFlop()->getHighestSet())) { + if((potential >=4 && 2 * tempFold * actualHand->getSmallBlind() >= actualHand->getCurrentBeRo()->getHighestSet()) || (bluff <= 5 && 4 * tempFold * actualHand->getSmallBlind() >= actualHand->getCurrentBeRo()->getHighestSet())) { // bluff - raise - if(bluff <=5) raise = ((bluff+1)/2) * actualHand->getFlop()->getHighestSet(); + if(bluff <=5) raise = ((bluff+1)/2) * actualHand->getCurrentBeRo()->getHighestSet(); // Betrag, der ber dem aktuell HighestSet gesetzt werden soll - else raise = ((potential - 2 ) / 2) * actualHand->getFlop()->getHighestSet(); + else raise = ((potential - 2 ) / 2) * actualHand->getCurrentBeRo()->getHighestSet(); // All In - if(actualHand->getFlop()->getHighestSet() + raise >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() + raise >= myCash) { mySet += myCash; myCash = 0; myAction = 6; - if(mySet > actualHand->getFlop()->getHighestSet()) actualHand->getFlop()->setHighestSet(mySet); + if(mySet > actualHand->getCurrentBeRo()->getHighestSet()) actualHand->getCurrentBeRo()->setHighestSet(mySet); } // sonst else { - myCash = myCash + mySet - actualHand->getFlop()->getHighestSet() - raise; - mySet = actualHand->getFlop()->getHighestSet() + raise; - actualHand->getFlop()->setHighestSet(mySet); + myCash = myCash + mySet - actualHand->getCurrentBeRo()->getHighestSet() - raise; + mySet = actualHand->getCurrentBeRo()->getHighestSet() + raise; + actualHand->getCurrentBeRo()->setHighestSet(mySet); myAction = 5; } } @@ -2871,7 +2850,7 @@ void LocalPlayer::flopEngine3() { else { // All In - if(actualHand->getFlop()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -2880,8 +2859,8 @@ void LocalPlayer::flopEngine3() { } // sonst else { - myCash = myCash - actualHand->getFlop()->getHighestSet() + mySet; - mySet = actualHand->getFlop()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } @@ -2961,7 +2940,7 @@ void LocalPlayer::turnEngine3() { // Potential int potential = (10*(5*(int)(percent*100.)+10*tempRand*2))/700-myDude; - int setToHighest = actualHand->getTurn()->getHighestSet() - mySet; + int setToHighest = actualHand->getCurrentBeRo()->getHighestSet() - mySet; // temp fr das Vielfache des Small Blind, sodass HighestSet zu hoch ist int tempFold; @@ -2975,7 +2954,7 @@ void LocalPlayer::turnEngine3() { } else { // CHECK und BET --> wenn noch keiner was gesetzt hat - if(actualHand->getTurn()->getHighestSet() == 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() == 0) { // CHECK --> wenn Potential klein if((potential<2 || bluff >= 80) && bluff > 10) { // check @@ -3003,42 +2982,42 @@ void LocalPlayer::turnEngine3() { myCash -= mySet; myAction = 4; } - actualHand->getTurn()->setHighestSet(mySet); + actualHand->getCurrentBeRo()->setHighestSet(mySet); } } // CALL und RAISE --> wenn bereits gesetzt wurde else { // RAISE --> wenn Potential besonders gut - if(potential >=4 && 2 * tempFold * actualHand->getSmallBlind() >= actualHand->getTurn()->getHighestSet() || (bluff <= 4 && 3 * tempFold * actualHand->getSmallBlind() >= actualHand->getTurn()->getHighestSet())) { + if(potential >=4 && 2 * tempFold * actualHand->getSmallBlind() >= actualHand->getCurrentBeRo()->getHighestSet() || (bluff <= 4 && 3 * tempFold * actualHand->getSmallBlind() >= actualHand->getCurrentBeRo()->getHighestSet())) { // bluff - raise - if(bluff <= 4) raise = ((bluff+1)/2) * actualHand->getTurn()->getHighestSet(); + if(bluff <= 4) raise = ((bluff+1)/2) * actualHand->getCurrentBeRo()->getHighestSet(); // Betrag, der ber dem aktuell HighestSet gesetzt werden soll - else raise = ( potential - 3 ) * actualHand->getTurn()->getHighestSet(); + else raise = ( potential - 3 ) * actualHand->getCurrentBeRo()->getHighestSet(); // All In - if(actualHand->getTurn()->getHighestSet() + raise >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() + raise >= myCash) { mySet += myCash; myCash = 0; myAction = 6; - if(mySet > actualHand->getTurn()->getHighestSet()) actualHand->getTurn()->setHighestSet(mySet); + if(mySet > actualHand->getCurrentBeRo()->getHighestSet()) actualHand->getCurrentBeRo()->setHighestSet(mySet); } // sonst else { - myCash = myCash + mySet - actualHand->getTurn()->getHighestSet() - raise; - mySet = actualHand->getTurn()->getHighestSet() + raise; - actualHand->getTurn()->setHighestSet(mySet); + myCash = myCash + mySet - actualHand->getCurrentBeRo()->getHighestSet() - raise; + mySet = actualHand->getCurrentBeRo()->getHighestSet() + raise; + actualHand->getCurrentBeRo()->setHighestSet(mySet); myAction = 5; } } // CALL --> bei normalen Potential else { // All In - if(actualHand->getTurn()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -3047,8 +3026,8 @@ void LocalPlayer::turnEngine3() { } // sonst else { - myCash = myCash - actualHand->getTurn()->getHighestSet() + mySet; - mySet = actualHand->getTurn()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } @@ -3123,7 +3102,7 @@ void LocalPlayer::riverEngine3() { // Potential int potential = (10*(5*(int)(percent*100.)+10*tempRand*1))/600-myDude; - int setToHighest = actualHand->getRiver()->getHighestSet() - mySet; + int setToHighest = actualHand->getCurrentBeRo()->getHighestSet() - mySet; // temp fr das Vielfache des Small Blind, sodass HighestSet zu hoch ist int tempFold; @@ -3137,7 +3116,7 @@ void LocalPlayer::riverEngine3() { } else { // CHECK und BET --> wenn noch keiner was gesetzt hat - if(actualHand->getRiver()->getHighestSet() == 0) { + if(actualHand->getCurrentBeRo()->getHighestSet() == 0) { // CHECK --> wenn Potential klein if((potential<2 || bluff >= 92) && bluff > 15) { // check @@ -3165,42 +3144,42 @@ void LocalPlayer::riverEngine3() { myCash -= mySet; myAction = 4; } - actualHand->getRiver()->setHighestSet(mySet); + actualHand->getCurrentBeRo()->setHighestSet(mySet); } } // CALL und RAISE --> wenn bereits gesetzt wurde else { // RAISE --> wenn Potential besonders gut - if(potential >=4 && 2 * tempFold * actualHand->getSmallBlind() >= actualHand->getRiver()->getHighestSet() || (bluff <= 2 && 4 * tempFold * actualHand->getSmallBlind() >= actualHand->getRiver()->getHighestSet())) { + if(potential >=4 && 2 * tempFold * actualHand->getSmallBlind() >= actualHand->getCurrentBeRo()->getHighestSet() || (bluff <= 2 && 4 * tempFold * actualHand->getSmallBlind() >= actualHand->getCurrentBeRo()->getHighestSet())) { // bluff - raise - if(bluff <= 2 ) raise = bluff * actualHand->getRiver()->getHighestSet(); + if(bluff <= 2 ) raise = bluff * actualHand->getCurrentBeRo()->getHighestSet(); // Betrag, der ber dem aktuell HighestSet gesetzt werden soll - else raise = ( potential - 3 ) * actualHand->getRiver()->getHighestSet(); + else raise = ( potential - 3 ) * actualHand->getCurrentBeRo()->getHighestSet(); // All In - if(actualHand->getRiver()->getHighestSet() + raise >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() + raise >= myCash) { mySet += myCash; myCash = 0; myAction = 6; - if(mySet > actualHand->getRiver()->getHighestSet()) actualHand->getRiver()->setHighestSet(mySet); + if(mySet > actualHand->getCurrentBeRo()->getHighestSet()) actualHand->getCurrentBeRo()->setHighestSet(mySet); } // sonst else { - myCash = myCash + mySet - actualHand->getRiver()->getHighestSet() - raise; - mySet = actualHand->getRiver()->getHighestSet() + raise; - actualHand->getRiver()->setHighestSet(mySet); + myCash = myCash + mySet - actualHand->getCurrentBeRo()->getHighestSet() - raise; + mySet = actualHand->getCurrentBeRo()->getHighestSet() + raise; + actualHand->getCurrentBeRo()->setHighestSet(mySet); myAction = 5; } } // CALL --> bei normalen Potential else { // All In - if(actualHand->getRiver()->getHighestSet() >= myCash) { + if(actualHand->getCurrentBeRo()->getHighestSet() >= myCash) { mySet += myCash; myCash = 0; @@ -3209,8 +3188,8 @@ void LocalPlayer::riverEngine3() { } // sonst else { - myCash = myCash - actualHand->getRiver()->getHighestSet() + mySet; - mySet = actualHand->getRiver()->getHighestSet(); + myCash = myCash - actualHand->getCurrentBeRo()->getHighestSet() + mySet; + mySet = actualHand->getCurrentBeRo()->getHighestSet(); myAction = 3; } } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 18d8fd13..4b90d8ac 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1492,9 +1492,9 @@ void mainWindowImpl::meInAction() { switch (currentHand->getActualRound()) { case 0: { - if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getPreflop()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } + if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } - if (currentGame->getPlayerArray()[0]->getMySet()== currentHand->getPreflop()->getHighestSet() && currentGame->getPlayerArray()[0]->getMyButton() == 3) { pushButton_CallCheckSet->setText("Check"); } + if (currentGame->getPlayerArray()[0]->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getPlayerArray()[0]->getMyButton() == 3) { pushButton_CallCheckSet->setText("Check"); } else { pushButton_CallCheckSet->setText("Call"); } pushButton_FoldAllin->setText("Fold"); } @@ -1503,14 +1503,14 @@ void mainWindowImpl::meInAction() { pushButton_FoldAllin->setText("Fold"); -// cout << "highestSet in meInAction " << currentHand->getFlop()->getHighestSet() << endl; - if (currentHand->getFlop()->getHighestSet() == 0) { +// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; + if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { pushButton_CallCheckSet->setText("Check"); pushButton_BetRaise->setText("Bet"); } - if (currentHand->getFlop()->getHighestSet() > 0 && currentHand->getFlop()->getHighestSet() > currentGame->getPlayerArray()[0]->getMySet()) { + if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getPlayerArray()[0]->getMySet()) { pushButton_CallCheckSet->setText("Call"); - if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getPreflop()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } + if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } } } break; @@ -1518,14 +1518,14 @@ void mainWindowImpl::meInAction() { pushButton_FoldAllin->setText("Fold"); -// cout << "highestSet in meInAction " << currentHand->getFlop()->getHighestSet() << endl; - if (currentHand->getTurn()->getHighestSet() == 0) { +// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; + if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { pushButton_CallCheckSet->setText("Check"); pushButton_BetRaise->setText("Bet"); } - if (currentHand->getTurn()->getHighestSet() > 0 && currentHand->getTurn()->getHighestSet() > currentGame->getPlayerArray()[0]->getMySet()) { + if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getPlayerArray()[0]->getMySet()) { pushButton_CallCheckSet->setText("Call"); - if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getPreflop()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } + if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } } } break; @@ -1533,14 +1533,14 @@ void mainWindowImpl::meInAction() { pushButton_FoldAllin->setText("Fold"); -// cout << "highestSet in meInAction " << currentHand->getFlop()->getHighestSet() << endl; - if (currentHand->getRiver()->getHighestSet() == 0) { +// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; + if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { pushButton_CallCheckSet->setText("Check"); pushButton_BetRaise->setText("Bet"); } - if (currentHand->getRiver()->getHighestSet() > 0 && currentHand->getRiver()->getHighestSet() > currentGame->getPlayerArray()[0]->getMySet()) { + if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getPlayerArray()[0]->getMySet()) { pushButton_CallCheckSet->setText("Call"); - if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getPreflop()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } + if (currentGame->getPlayerArray()[0]->getMyCash()+currentGame->getPlayerArray()[0]->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { pushButton_BetRaise->setText("Raise"); } } } break; @@ -1625,18 +1625,8 @@ void mainWindowImpl::myCall(){ int tempHighestSet = 0; HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); - switch (currentHand->getActualRound()) { - - case 0: {tempHighestSet = currentHand->getPreflop()->getHighestSet();} - break; - case 1: {tempHighestSet = currentHand->getFlop()->getHighestSet();} - break; - case 2: {tempHighestSet = currentHand->getTurn()->getHighestSet();} - break; - case 3: {tempHighestSet = currentHand->getRiver()->getHighestSet();} - break; - default: {} - } + + tempHighestSet = currentHand->getCurrentBeRo()->getHighestSet(); if (currentHand->getPlayerArray()[0]->getMyCash()+currentHand->getPlayerArray()[0]->getMySet() <= tempHighestSet) { @@ -1691,18 +1681,8 @@ void mainWindowImpl::myRaise(){ int tempHighestSet = 0; HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); - switch (currentHand->getActualRound()) { - case 0: {tempHighestSet = currentHand->getPreflop()->getHighestSet();} - break; - case 1: {tempHighestSet = currentHand->getFlop()->getHighestSet();} - break; - case 2: {tempHighestSet = currentHand->getTurn()->getHighestSet();} - break; - case 3: {tempHighestSet = currentHand->getRiver()->getHighestSet();} - break; - default: {} - } + tempHighestSet = currentHand->getCurrentBeRo()->getHighestSet(); spinBox_set->setMinimum(tempHighestSet*2 - currentHand->getPlayerArray()[0]->getMySet()); spinBox_set->setMaximum(currentHand->getPlayerArray()[0]->getMyCash()); @@ -1728,19 +1708,7 @@ void mainWindowImpl::mySet(){ currentHand->getPlayerArray()[0]->setMyAction(6); } - - switch (currentHand->getActualRound()) { - - case 0: {currentHand->getPreflop()->setHighestSet(currentHand->getPlayerArray()[0]->getMySet());} - break; - case 1: {currentHand->getFlop()->setHighestSet( currentHand->getPlayerArray()[0]->getMySet());} - break; - case 2: {currentHand->getTurn()->setHighestSet( currentHand->getPlayerArray()[0]->getMySet());} - break; - case 3: {currentHand->getRiver()->setHighestSet( currentHand->getPlayerArray()[0]->getMySet());} - break; - default: {} - } + currentHand->getCurrentBeRo()->setHighestSet(currentHand->getPlayerArray()[0]->getMySet()); if(myActionIsRaise) { //do not if allIn @@ -1780,18 +1748,7 @@ void mainWindowImpl::myAllIn(){ currentHand->getPlayerArray()[0]->setMyCash(0); currentHand->getPlayerArray()[0]->setMyAction(6); - switch (currentHand->getActualRound()) { - - case 0: {if(currentHand->getPlayerArray()[0]->getMySet() > currentHand->getPreflop()->getHighestSet()) currentHand->getPreflop()->setHighestSet(currentHand->getPlayerArray()[0]->getMySet());} - break; - case 1: {if(currentHand->getPlayerArray()[0]->getMySet() > currentHand->getFlop()->getHighestSet()) currentHand->getFlop()->setHighestSet(currentHand->getPlayerArray()[0]->getMySet());} - break; - case 2: {if(currentHand->getPlayerArray()[0]->getMySet() > currentHand->getTurn()->getHighestSet()) currentHand->getTurn()->setHighestSet(currentHand->getPlayerArray()[0]->getMySet());} - break; - case 3: {if(currentHand->getPlayerArray()[0]->getMySet() > currentHand->getRiver()->getHighestSet()) currentHand->getRiver()->setHighestSet(currentHand->getPlayerArray()[0]->getMySet());} - break; - default: {} - } + if(currentHand->getPlayerArray()[0]->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { currentHand->getCurrentBeRo()->setHighestSet(currentHand->getPlayerArray()[0]->getMySet());} currentHand->getPlayerArray()[0]->setMyTurn(0); @@ -1850,29 +1807,29 @@ void mainWindowImpl::beRoAnimation2(int myBeRoID) { void mainWindowImpl::preflopAnimation1() { preflopAnimation1Timer->start(nextPlayerSpeed2); } -void mainWindowImpl::preflopAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getPreflop()->run(); } +void mainWindowImpl::preflopAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->run(); } void mainWindowImpl::preflopAnimation2() { preflopAnimation2Timer->start(preflopNextPlayerSpeed); } -void mainWindowImpl::preflopAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getPreflop()->nextPlayer(); } +void mainWindowImpl::preflopAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->nextPlayer(); } void mainWindowImpl::flopAnimation1() { flopAnimation1Timer->start(nextPlayerSpeed2); } -void mainWindowImpl::flopAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getFlop()->run(); } +void mainWindowImpl::flopAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->run(); } void mainWindowImpl::flopAnimation2() { flopAnimation2Timer->start(nextPlayerSpeed3); } -void mainWindowImpl::flopAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getFlop()->nextPlayer(); } +void mainWindowImpl::flopAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->nextPlayer(); } void mainWindowImpl::turnAnimation1() { turnAnimation1Timer->start(nextPlayerSpeed2); } -void mainWindowImpl::turnAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getTurn()->run(); } +void mainWindowImpl::turnAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->run(); } void mainWindowImpl::turnAnimation2() { turnAnimation2Timer->start(nextPlayerSpeed3); } -void mainWindowImpl::turnAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getTurn()->nextPlayer(); } +void mainWindowImpl::turnAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->nextPlayer(); } void mainWindowImpl::riverAnimation1() { riverAnimation1Timer->start(nextPlayerSpeed2); } -void mainWindowImpl::riverAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getRiver()->run(); } +void mainWindowImpl::riverAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->run(); } void mainWindowImpl::riverAnimation2() { riverAnimation2Timer->start(nextPlayerSpeed3); } -void mainWindowImpl::riverAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getRiver()->nextPlayer(); } +void mainWindowImpl::riverAnimation2Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->nextPlayer(); } void mainWindowImpl::postRiverAnimation1() { postRiverAnimation1Timer->start(nextPlayerSpeed2); } void mainWindowImpl::postRiverAnimation1Action() { mySession->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->run(); } @@ -2088,7 +2045,7 @@ void mainWindowImpl::postRiverRunAnimation5() { label_Pot->setText(""); for(i=0; igetPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1 && currentHand->getPlayerArray()[i]->getMyCardsValueInt() == currentHand->getRiver()->getHighestCardsValue() ) { + if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1 && currentHand->getPlayerArray()[i]->getMyCardsValueInt() == currentHand->getCurrentBeRo()->getHighestCardsValue() ) { cashTopLabelArray[i]->setText(""); } @@ -2098,7 +2055,7 @@ void mainWindowImpl::postRiverRunAnimation5() { label_Pot->setText("Pot"); for(i=0; igetPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1 && currentHand->getPlayerArray()[i]->getMyCardsValueInt() == currentHand->getRiver()->getHighestCardsValue() ) { + if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != 1 && currentHand->getPlayerArray()[i]->getMyCardsValueInt() == currentHand->getCurrentBeRo()->getHighestCardsValue() ) { cashTopLabelArray[i]->setText("Cash:"); }