adds activePlayerList and runningPlayerList (IV)
This commit is contained in:
@@ -24,21 +24,30 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_PREFLOP), bigBlindPosition(0)
|
||||
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_PREFLOP)
|
||||
|
||||
{
|
||||
setHighestSet(2*getSmallBlind());
|
||||
|
||||
// // BigBlind ermitteln
|
||||
bigBlindPosition = getDealerPosition();
|
||||
// bigBlindPosition = getDealerPosition();
|
||||
bigBlindPosition = getMyHand()->getActivePlayerList()->begin();
|
||||
|
||||
int i;
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
|
||||
bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
// int i;
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
|
||||
// bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
// }
|
||||
|
||||
PlayerListIterator it;
|
||||
|
||||
for(it=getMyHand()->getActivePlayerList()->begin(); it!=getMyHand()->getActivePlayerList()->end(); it++) {
|
||||
if((*it)->getMyButton() == BUTTON_BIG_BLIND) {
|
||||
bigBlindPosition = it;
|
||||
}
|
||||
}
|
||||
|
||||
// // erste Spielernummer fr preflopRun() setzen
|
||||
setPlayersTurn(bigBlindPosition);
|
||||
setPlayersTurn((*bigBlindPosition)->getMyID());
|
||||
|
||||
}
|
||||
|
||||
@@ -64,18 +73,18 @@ void LocalBeRoPreflop::run() {
|
||||
}
|
||||
|
||||
// BigBlind ermitteln
|
||||
bigBlindPosition = getDealerPosition();
|
||||
// bigBlindPosition = getDealerPosition();
|
||||
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
|
||||
bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
}
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
|
||||
// bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
// }
|
||||
|
||||
// naechsten Spieler ermitteln
|
||||
for(i=0; (i<MAX_NUMBER_OF_PLAYERS && (!(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyActiveStatus()) || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_FOLD || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_ALLIN)) || i==0; i++) {
|
||||
|
||||
setPlayersTurn((getPlayersTurn()+1)%(MAX_NUMBER_OF_PLAYERS));
|
||||
// falls BigBlind, dann PreflopFirstRound zuende
|
||||
if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND && getMyHand()->getPlayerArray()[bigBlindPosition]->getMySet() < 2*getSmallBlind()) setFirstRound(0);
|
||||
if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND && (*bigBlindPosition)->getMySet() < 2*getSmallBlind()) setFirstRound(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user