This commit is contained in:
@@ -45,19 +45,6 @@ LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState g
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -92,109 +79,117 @@ void LocalBeRo::nextPlayer() {
|
|||||||
|
|
||||||
void LocalBeRo::run() {
|
void LocalBeRo::run() {
|
||||||
|
|
||||||
if (firstRun || firstRunGui) {
|
if(firstRunGui) {
|
||||||
|
firstRunGui = false;
|
||||||
|
myHand->getGuiInterface()->dealBeRoCards(myBeRoID);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
// HACK
|
if(firstRun) {
|
||||||
if(firstRunGui) {
|
|
||||||
firstRunGui = false;
|
|
||||||
myHand->getGuiInterface()->dealBeRoCards(myBeRoID);
|
|
||||||
}
|
|
||||||
|
|
||||||
firstRun = false;
|
|
||||||
/*
|
|
||||||
|
|
||||||
// determine smallBlindPosition
|
|
||||||
PlayerListIterator smallBlindPositionIt;
|
|
||||||
|
|
||||||
for(smallBlindPositionIt=myHand->getActivePlayerList()->begin(); smallBlindPositionIt!=myHand->getActivePlayerList()->end(); smallBlindPositionIt++) {
|
|
||||||
if((*smallBlindPositionIt)->getMyButton() == BUTTON_SMALL_BLIND) break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// determine running player before smallBlind (for heads up: determine dealer/smallblind)
|
|
||||||
PlayerListIterator it_1, it_2;
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
// running player before smallBlind
|
|
||||||
if(myHand->getActivePlayerList()->size() > 2) {
|
|
||||||
it_1 = smallBlindPositionIt;
|
|
||||||
for(i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
|
||||||
if(it_1 == myHand->getActivePlayerList()->begin()) it_1 = myHand->getActivePlayerList()->end();
|
|
||||||
it_1--;
|
|
||||||
it_2 = find(myHand->getRunningPlayerList()->begin(), myHand->getRunningPlayerList()->end(), *it_1);
|
|
||||||
// running player found
|
|
||||||
if(it_2 != myHand->getRunningPlayerList()->end()) {
|
|
||||||
lastPlayersTurnIt = it_2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// heads up: bigBlind begins -> dealer/smallBlind is running player before bigBlind
|
|
||||||
else {
|
|
||||||
it_1 = find(myHand->getRunningPlayerList()->begin(), myHand->getRunningPlayerList()->end(), *smallBlindPositionIt);
|
|
||||||
if( it_1 == myHand->getRunningPlayerList()->end() ) {
|
|
||||||
cout << "ERROR - lastPlayersTurnIt-detection in localBeRo" << endl;
|
|
||||||
}
|
|
||||||
// smallBlind found
|
|
||||||
else {
|
|
||||||
lastPlayersTurnIt = it_1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
currentPlayersTurnIt = lastPlayersTurnIt;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!(myHand->getAllInCondition())) {
|
|
||||||
|
|
||||||
|
firstRun = false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
// determine smallBlindPosition
|
// determine smallBlindPosition
|
||||||
// PlayerListIterator smallBlindPositionIt;
|
PlayerListIterator smallBlindPositionIt;
|
||||||
|
|
||||||
// for(smallBlindPositionIt=myHand->getActivePlayerList()->begin(); smallBlindPositionIt!=myHand->getActivePlayerList()->end(); smallBlindPositionIt++) {
|
for(smallBlindPositionIt=myHand->getActivePlayerList()->begin(); smallBlindPositionIt!=myHand->getActivePlayerList()->end(); smallBlindPositionIt++) {
|
||||||
// if((*smallBlindPositionIt)->getMyButton() == BUTTON_SMALL_BLIND) break;
|
if((*smallBlindPositionIt)->getMyButton() == BUTTON_SMALL_BLIND) break;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// determine running player before smallBlind (for heads up: determine dealer/smallblind)
|
// determine running player before smallBlind (for heads up: determine dealer/smallblind)
|
||||||
PlayerListIterator it_1, it_2;
|
PlayerListIterator it_1, it_2;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
// running player before smallBlind
|
// running player before smallBlind
|
||||||
bool runningPlayerFound = false;
|
|
||||||
if(myHand->getActivePlayerList()->size() > 2) {
|
if(myHand->getActivePlayerList()->size() > 2) {
|
||||||
|
it_1 = smallBlindPositionIt;
|
||||||
it_1 = myHand->getActivePlayerIt(smallBlindPositionId);
|
|
||||||
assert( it_1 != myHand->getActivePlayerList()->end() );
|
|
||||||
|
|
||||||
for(i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
for(i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
||||||
|
|
||||||
if(it_1 == myHand->getActivePlayerList()->begin()) it_1 = myHand->getActivePlayerList()->end();
|
if(it_1 == myHand->getActivePlayerList()->begin()) it_1 = myHand->getActivePlayerList()->end();
|
||||||
it_1--;
|
it_1--;
|
||||||
|
it_2 = find(myHand->getRunningPlayerList()->begin(), myHand->getRunningPlayerList()->end(), *it_1);
|
||||||
it_2 = myHand->getRunningPlayerIt((*it_1)->getMyUniqueID());
|
|
||||||
// running player found
|
// running player found
|
||||||
if(it_2 != myHand->getRunningPlayerList()->end()) {
|
if(it_2 != myHand->getRunningPlayerList()->end()) {
|
||||||
firstRoundLastPlayersTurnId = (*it_2)->getMyUniqueID();
|
lastPlayersTurnIt = it_2;
|
||||||
runningPlayerFound = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(runningPlayerFound);
|
|
||||||
}
|
}
|
||||||
// heads up: bigBlind begins -> dealer/smallBlind is running player before bigBlind
|
// heads up: bigBlind begins -> dealer/smallBlind is running player before bigBlind
|
||||||
else {
|
else {
|
||||||
firstRoundLastPlayersTurnId = smallBlindPositionId;
|
it_1 = find(myHand->getRunningPlayerList()->begin(), myHand->getRunningPlayerList()->end(), *smallBlindPositionIt);
|
||||||
|
if( it_1 == myHand->getRunningPlayerList()->end() ) {
|
||||||
|
cout << "ERROR - lastPlayersTurnIt-detection in localBeRo" << endl;
|
||||||
|
}
|
||||||
|
// smallBlind found
|
||||||
|
else {
|
||||||
|
lastPlayersTurnIt = it_1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentPlayersTurnId = firstRoundLastPlayersTurnId;
|
currentPlayersTurnIt = lastPlayersTurnIt;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(!(myHand->getAllInCondition())) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// determine smallBlindPosition
|
||||||
|
// PlayerListIterator smallBlindPositionIt;
|
||||||
|
|
||||||
|
// for(smallBlindPositionIt=myHand->getActivePlayerList()->begin(); smallBlindPositionIt!=myHand->getActivePlayerList()->end(); smallBlindPositionIt++) {
|
||||||
|
// if((*smallBlindPositionIt)->getMyButton() == BUTTON_SMALL_BLIND) break;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// determine running player before smallBlind (for heads up: determine dealer/smallblind)
|
||||||
|
PlayerListIterator it_1, it_2;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
// running player before smallBlind
|
||||||
|
bool runningPlayerFound = false;
|
||||||
|
if(myHand->getActivePlayerList()->size() > 2) {
|
||||||
|
|
||||||
|
it_1 = myHand->getActivePlayerIt(smallBlindPositionId);
|
||||||
|
assert( it_1 != myHand->getActivePlayerList()->end() );
|
||||||
|
|
||||||
|
for(i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
||||||
|
|
||||||
|
if(it_1 == myHand->getActivePlayerList()->begin()) it_1 = myHand->getActivePlayerList()->end();
|
||||||
|
it_1--;
|
||||||
|
|
||||||
|
it_2 = myHand->getRunningPlayerIt((*it_1)->getMyUniqueID());
|
||||||
|
// running player found
|
||||||
|
if(it_2 != myHand->getRunningPlayerList()->end()) {
|
||||||
|
firstRoundLastPlayersTurnId = (*it_2)->getMyUniqueID();
|
||||||
|
runningPlayerFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(runningPlayerFound);
|
||||||
|
}
|
||||||
|
// heads up: bigBlind begins -> dealer/smallBlind is running player before bigBlind
|
||||||
|
else {
|
||||||
|
firstRoundLastPlayersTurnId = smallBlindPositionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentPlayersTurnId = firstRoundLastPlayersTurnId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -210,17 +205,6 @@ void LocalBeRo::run() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
//log the turned cards
|
//log the turned cards
|
||||||
if(!logBoardCardsDone) {
|
if(!logBoardCardsDone) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user