invisible check in heads up bugfix

This commit is contained in:
doitux
2007-05-20 13:03:43 +00:00
parent 5438aa487c
commit 63b278a88e
7 changed files with 34 additions and 14 deletions
+10 -5
View File
@@ -23,7 +23,7 @@
//using namespace std;
LocalFlop::LocalFlop(HandInterface* bR, int id, int qP, int dP, int sB) : FlopInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstFlopRun(1), firstFlopRound(1), playersTurn(dP)
LocalFlop::LocalFlop(HandInterface* bR, int id, int qP, int dP, int sB) : FlopInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstFlopRun(1), firstFlopRound(1), firstHeadsUpFlopRound(1), playersTurn(dP)
{
int i;
@@ -93,10 +93,14 @@ void LocalFlop::flopRun() {
myHand->setBettingRoundsPlayed(1);
}
// naechsten Spieler ermitteln
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
if( !(myHand->getActualQuantityPlayers() < 3 && firstHeadsUpFlopRound == 1) ) {
// not first round in heads up (for headsup dealer is smallblind so it is dealers turn)
// naechsten Spieler ermitteln
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
}
else { firstHeadsUpFlopRound = 0; }
//Spieler-Position vor SmallBlind-Position ermitteln
int activePlayerBeforeSmallBlind = smallBlindPosition;
@@ -108,6 +112,7 @@ void LocalFlop::flopRun() {
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind) { firstFlopRound = 0; }
+1
View File
@@ -63,6 +63,7 @@ private:
bool firstFlopRun;
bool firstFlopRound;
bool firstHeadsUpFlopRound;
int playersTurn;
};
+9 -4
View File
@@ -25,7 +25,7 @@
using namespace std;
LocalRiver::LocalRiver(HandInterface* bR, int id, int qP, int dP, int sB) : RiverInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRiverRun(1), firstRiverRound(1), playersTurn(dP), highestCardsValue(0)
LocalRiver::LocalRiver(HandInterface* bR, int id, int qP, int dP, int sB) : RiverInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstRiverRun(1), firstRiverRound(1), firstHeadsUpRiverRound(1), playersTurn(dP), highestCardsValue(0)
{ int i;
@@ -95,9 +95,14 @@ void LocalRiver::riverRun() {
myHand->setBettingRoundsPlayed(3);
}
// nᅵhsten Spieler ermitteln
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
if( !(myHand->getActualQuantityPlayers() < 3 && firstHeadsUpRiverRound == 1) ) {
// not first round in heads up (for headsup dealer is smallblind so it is dealers turn)
// naechsten Spieler ermitteln
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
}
else { firstHeadsUpRiverRound = 0; }
//Spieler-Position vor SmallBlind-Position ermitteln
int activePlayerBeforeSmallBlind = smallBlindPosition;
+1
View File
@@ -67,6 +67,7 @@ private:
bool firstRiverRun;
bool firstRiverRound;
bool firstHeadsUpRiverRound;
int playersTurn;
int highestCardsValue;
+9 -4
View File
@@ -24,7 +24,7 @@
//using namespace std;
LocalTurn::LocalTurn(HandInterface* bR, int id, int qP, int dP, int sB) : TurnInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstTurnRun(1), firstTurnRound(1), playersTurn(dP)
LocalTurn::LocalTurn(HandInterface* bR, int id, int qP, int dP, int sB) : TurnInterface(), myHand(bR), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), firstTurnRun(1), firstTurnRound(1), firstHeadsUpTurnRound(1), playersTurn(dP)
{ int i;
@@ -95,9 +95,14 @@ void LocalTurn::turnRun() {
myHand->setBettingRoundsPlayed(2);
}
// nhsten Spieler ermitteln
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
if( !(myHand->getActualQuantityPlayers() < 3 && firstHeadsUpTurnRound == 1) ) {
// not first round in heads up (for headsup dealer is smallblind so it is dealers turn)
// naechsten Spieler ermitteln
do { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6);
}
else { firstHeadsUpTurnRound = 0; }
//Spieler-Position vor SmallBlind-Position ermitteln
int activePlayerBeforeSmallBlind = smallBlindPosition;
+1
View File
@@ -61,6 +61,7 @@ private:
bool firstTurnRun;
bool firstTurnRound;
bool firstHeadsUpTurnRound;
int playersTurn;
};
+3 -1
View File
@@ -87,9 +87,11 @@ int main( int argc, char **argv )
QTranslator translator;
translator.load(QString(":/translations/resources/translations/pokerth_") + locale);
a.installTranslator(&translator);
///////////////////////////////////////////////////
qRegisterMetaType<boost::shared_ptr<Game> >("boost::shared_ptr<Game>");
///////////////////////////////////////////////////
boost::shared_ptr<GuiInterface> myGuiInterface(new GuiWrapper(myConfig));
{