adds activePlayerList and runningPlayerList (XXIII) - bugfixes
This commit is contained in:
@@ -68,6 +68,9 @@ protected:
|
|||||||
void setHighestSet(int theValue) { highestSet = theValue; }
|
void setHighestSet(int theValue) { highestSet = theValue; }
|
||||||
int getHighestSet() const { return highestSet;}
|
int getHighestSet() const { return highestSet;}
|
||||||
|
|
||||||
|
void setFirstRun(bool theValue) { firstRun = theValue;}
|
||||||
|
bool getFirstRun() const { return firstRun;}
|
||||||
|
|
||||||
void setFirstRound(bool theValue) { firstRound = theValue;}
|
void setFirstRound(bool theValue) { firstRound = theValue;}
|
||||||
bool getFirstRound() const { return firstRound;}
|
bool getFirstRound() const { return firstRound;}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,31 @@ LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, unsigned dP, int s
|
|||||||
|
|
||||||
setHighestSet(2*getSmallBlind());
|
setHighestSet(2*getSmallBlind());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LocalBeRoPreflop::~LocalBeRoPreflop()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LocalBeRoPreflop::run() {
|
||||||
|
|
||||||
|
if(getFirstRun()) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// determine bigBlindPosition -> old: delete
|
// determine bigBlindPosition -> old: delete
|
||||||
// for(bigBlindPositionIt=getMyHand()->getActivePlayerList()->begin(); bigBlindPositionIt!=getMyHand()->getActivePlayerList()->end(); bigBlindPositionIt++) {
|
// for(bigBlindPositionIt=getMyHand()->getActivePlayerList()->begin(); bigBlindPositionIt!=getMyHand()->getActivePlayerList()->end(); bigBlindPositionIt++) {
|
||||||
// if((*bigBlindPositionIt)->getMyButton() == BUTTON_BIG_BLIND) break;
|
// if((*bigBlindPositionIt)->getMyButton() == BUTTON_BIG_BLIND) break;
|
||||||
@@ -150,18 +175,22 @@ LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, unsigned dP, int s
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setFirstRun(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LocalBeRoPreflop::~LocalBeRoPreflop()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void LocalBeRoPreflop::run() {
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
bool allHighestSet = true;
|
bool allHighestSet = true;
|
||||||
@@ -262,6 +291,8 @@ void LocalBeRoPreflop::run() {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// cout << "firstRound. " << getFirstRound() << " - allHighestSet: " << allHighestSet << endl;
|
||||||
|
|
||||||
// prfen, ob Preflop wirklich dran ist
|
// prfen, ob Preflop wirklich dran ist
|
||||||
if(!getFirstRound() && allHighestSet) {
|
if(!getFirstRound() && allHighestSet) {
|
||||||
|
|
||||||
|
|||||||
@@ -485,6 +485,7 @@ void LocalHand::switchRounds() {
|
|||||||
// refresh runningPlayerList
|
// refresh runningPlayerList
|
||||||
for(it=runningPlayerList->begin(); it!=runningPlayerList->end(); ) {
|
for(it=runningPlayerList->begin(); it!=runningPlayerList->end(); ) {
|
||||||
if((*it)->getMyAction() == PLAYER_ACTION_FOLD || (*it)->getMyAction() == PLAYER_ACTION_ALLIN) {
|
if((*it)->getMyAction() == PLAYER_ACTION_FOLD || (*it)->getMyAction() == PLAYER_ACTION_ALLIN) {
|
||||||
|
|
||||||
it = runningPlayerList->erase(it);
|
it = runningPlayerList->erase(it);
|
||||||
if(!(runningPlayerList->empty())) {
|
if(!(runningPlayerList->empty())) {
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -266,7 +266,7 @@ void Game::raiseBlinds() {
|
|||||||
raiseBlinds = true;
|
raiseBlinds = true;
|
||||||
lastHandBlindsRaised = actualHandID;
|
lastHandBlindsRaised = actualHandID;
|
||||||
|
|
||||||
cout << "raise now on hands \n";
|
// cout << "raise now on hands \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -274,7 +274,7 @@ void Game::raiseBlinds() {
|
|||||||
raiseBlinds = true;
|
raiseBlinds = true;
|
||||||
lastTimeBlindsRaised = blindsTimer.elapsed().total_seconds()/60;
|
lastTimeBlindsRaised = blindsTimer.elapsed().total_seconds()/60;
|
||||||
|
|
||||||
cout << "raise now on minutes \n";
|
// cout << "raise now on minutes \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ void Game::raiseBlinds() {
|
|||||||
|
|
||||||
if (myGameData.raiseMode == DOUBLE_BLINDS) {
|
if (myGameData.raiseMode == DOUBLE_BLINDS) {
|
||||||
actualSmallBlind *= 2;
|
actualSmallBlind *= 2;
|
||||||
cout << "double small blind \n";
|
// cout << "double small blind \n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Increase the position of the list
|
// Increase the position of the list
|
||||||
@@ -296,35 +296,35 @@ void Game::raiseBlinds() {
|
|||||||
it = find(blindsList.begin(), blindsList.end(), actualSmallBlind);
|
it = find(blindsList.begin(), blindsList.end(), actualSmallBlind);
|
||||||
if(it != blindsList.end()) {
|
if(it != blindsList.end()) {
|
||||||
it++;
|
it++;
|
||||||
cout << "increase position in blindslist \n";
|
// cout << "increase position in blindslist \n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cout << "blindslist exceeds\n";
|
// cout << "blindslist exceeds\n";
|
||||||
if(actualSmallBlind == myGameData.firstSmallBlind) {
|
if(actualSmallBlind == myGameData.firstSmallBlind) {
|
||||||
it = blindsList.begin();
|
it = blindsList.begin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { cout << "blindslist is empty \n"; }
|
// else { cout << "blindslist is empty \n"; }
|
||||||
// Check if we can get an element of the list or the position exceeds the lis
|
// Check if we can get an element of the list or the position exceeds the lis
|
||||||
if (blindsList.empty() || it == blindsList.end()) {
|
if (blindsList.empty() || it == blindsList.end()) {
|
||||||
|
|
||||||
// The position exceeds the list
|
// The position exceeds the list
|
||||||
if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) {
|
if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) {
|
||||||
actualSmallBlind *= 2;
|
actualSmallBlind *= 2;
|
||||||
cout << "after blindslist double blind\n";
|
// cout << "after blindslist double blind\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(myGameData.afterManualBlindsMode == AFTERMB_RAISE_ABOUT) {
|
if(myGameData.afterManualBlindsMode == AFTERMB_RAISE_ABOUT) {
|
||||||
actualSmallBlind += myGameData.afterMBAlwaysRaiseValue;
|
actualSmallBlind += myGameData.afterMBAlwaysRaiseValue;
|
||||||
cout << "after blindslist increase about x \n";
|
// cout << "after blindslist increase about x \n";
|
||||||
}
|
}
|
||||||
else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; }
|
// else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Grab the blinds amount from the list
|
// Grab the blinds amount from the list
|
||||||
actualSmallBlind = *it;
|
actualSmallBlind = *it;
|
||||||
cout << "set new small blind from blindslist \n";
|
// cout << "set new small blind from blindslist \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user