cleaning code and hopefully last part of refactoring playerArray to playerLists ;)
This commit is contained in:
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
virtual ~BoardInterface();
|
||||
//
|
||||
virtual void setPlayerLists(/*std::vector<boost::shared_ptr<PlayerInterface> >,*/ PlayerList, PlayerList, PlayerList) =0;
|
||||
virtual void setPlayerLists(PlayerList, PlayerList, PlayerList) =0;
|
||||
virtual void setHand(HandInterface*) =0;
|
||||
//
|
||||
virtual void setMyCards(int* theValue) =0;
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
|
||||
virtual ~EngineFactory();
|
||||
|
||||
virtual HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, /*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
|
||||
virtual HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
|
||||
virtual BoardInterface* createBoard() =0;
|
||||
virtual boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) =0;
|
||||
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB) =0;
|
||||
|
||||
@@ -36,7 +36,6 @@ public:
|
||||
|
||||
virtual void start() = 0;
|
||||
|
||||
// virtual std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const =0; // delete
|
||||
virtual PlayerList getSeatsList() const =0;
|
||||
virtual PlayerList getActivePlayerList() const =0;
|
||||
virtual PlayerList getRunningPlayerList() const =0;
|
||||
|
||||
@@ -54,24 +54,7 @@ LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState g
|
||||
throw LocalException(__FILE__, __LINE__, ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// int i;
|
||||
|
||||
//SmallBlind-Position ermitteln
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if (myHand->getPlayerArray()[i]->getMyButton() == 2) smallBlindPosition = i;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LocalBeRo::~LocalBeRo()
|
||||
@@ -80,11 +63,6 @@ LocalBeRo::~LocalBeRo()
|
||||
|
||||
void LocalBeRo::nextPlayer() {
|
||||
|
||||
// myHand->getPlayerArray()[playersTurn]->action();
|
||||
|
||||
|
||||
// cout << "playerID in nextPlayer(): " << (*currentPlayersTurnIt)->getMyID() << endl;
|
||||
|
||||
PlayerListConstIterator currentPlayersTurnConstIt = myHand->getRunningPlayerIt(currentPlayersTurnId);
|
||||
if(currentPlayersTurnConstIt == myHand->getRunningPlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||
@@ -106,69 +84,8 @@ void LocalBeRo::run() {
|
||||
|
||||
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())) {
|
||||
|
||||
|
||||
|
||||
// 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;
|
||||
|
||||
@@ -201,31 +118,11 @@ void LocalBeRo::run() {
|
||||
// heads up: bigBlind begins -> dealer/smallBlind is running player before bigBlind
|
||||
else {
|
||||
firstRoundLastPlayersTurnId = smallBlindPositionId;
|
||||
}
|
||||
|
||||
}
|
||||
currentPlayersTurnId = firstRoundLastPlayersTurnId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//log the turned cards
|
||||
if(!logBoardCardsDone) {
|
||||
|
||||
@@ -248,18 +145,11 @@ void LocalBeRo::run() {
|
||||
|
||||
bool allHighestSet = true;
|
||||
|
||||
// prfe, ob alle Sets gleich sind ( falls nicht, dann allHighestSet = 0 )
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if(myHand->getPlayerArray()[i]->getMyActiveStatus() && myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) {
|
||||
// if(highestSet != myHand->getPlayerArray()[i]->getMySet()) { allHighestSet=0; }
|
||||
// }
|
||||
// }
|
||||
|
||||
PlayerListIterator it;
|
||||
PlayerListIterator it_c;
|
||||
|
||||
|
||||
// test if all running players have same sets (else allHighestSet = false)
|
||||
// check if all running players have same sets (else allHighestSet = false)
|
||||
for( it_c = myHand->getRunningPlayerList()->begin(); it_c != myHand->getRunningPlayerList()->end(); it_c++) {
|
||||
if(highestSet != (*it_c)->getMySet()) {
|
||||
allHighestSet = false;
|
||||
@@ -276,11 +166,6 @@ void LocalBeRo::run() {
|
||||
//also gehe in naechste bero
|
||||
myHand->setCurrentRound(myBeRoID+1);
|
||||
|
||||
//Action loeschen und ActionButtons refresh
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if(myHand->getPlayerArray()[i]->getMyAction() != 1 && myHand->getPlayerArray()[i]->getMyAction() != 6) myHand->getPlayerArray()[i]->setMyAction(0);
|
||||
// }
|
||||
|
||||
//Action loeschen und ActionButtons refresh
|
||||
for(it_c=myHand->getRunningPlayerList()->begin(); it_c!=myHand->getRunningPlayerList()->end(); it_c++) {
|
||||
(*it_c)->setMyAction(PLAYER_ACTION_NONE);
|
||||
@@ -300,11 +185,6 @@ void LocalBeRo::run() {
|
||||
else {
|
||||
// aktuelle bero ist wirklich dran
|
||||
|
||||
// Anzahl der effektiv gespielten Runden (des human player) erhöhen
|
||||
// if(myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||
// myHand->setBettingRoundsPlayed(myBeRoID);
|
||||
// }
|
||||
|
||||
// Anzahl der effektiv gespielten Runden (des human player) erhöhen
|
||||
it_c = myHand->getActivePlayerIt(0);
|
||||
if( it_c != myHand->getActivePlayerList()->end() ) {
|
||||
@@ -313,77 +193,22 @@ void LocalBeRo::run() {
|
||||
myHand->setBettingRoundsPlayed(myBeRoID);
|
||||
}
|
||||
}
|
||||
|
||||
// determine next running player
|
||||
PlayerListConstIterator currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
|
||||
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||
}
|
||||
|
||||
//// !!!!!!!!!!!!!!!!1!!!! very buggy, rule breaking -> TODO !!!!!!!!!!!!11!!!!!!!! //////////////
|
||||
|
||||
//// headsup:
|
||||
//// preflop: dealer is small blind and begins
|
||||
//// flop, trun, river: big blind begins
|
||||
|
||||
//// !!!!!!!!! attention: exception if player failed before !!!!!!!!
|
||||
|
||||
// if( !(myHand->getCurrentQuantityPlayers() < 3 && firstHeadsUpRound == 1) || myHand->getPlayerArray()[playersTurn]->getMyActiveStatus() == 0 ) {
|
||||
// not first round in heads up (for headsup dealer is smallblind so it is dealers turn)
|
||||
|
||||
// naechsten Spieler ermitteln
|
||||
// int i;
|
||||
// for(i=0; (i<MAX_NUMBER_OF_PLAYERS && ((myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) == 0 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6)) || i==0; i++) {
|
||||
// playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
// }
|
||||
// firstHeadsUpRound = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
// determine next running player
|
||||
// currentPlayersTurnIt++;
|
||||
// if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
|
||||
|
||||
|
||||
// determine next running player
|
||||
PlayerListConstIterator currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
|
||||
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||
}
|
||||
currentPlayersTurnIt++;
|
||||
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
|
||||
|
||||
currentPlayersTurnIt++;
|
||||
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
|
||||
|
||||
currentPlayersTurnId = (*currentPlayersTurnIt)->getMyUniqueID();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// else { firstHeadsUpRound = 0; }
|
||||
|
||||
////// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ////////////////
|
||||
|
||||
//Spieler-Position vor SmallBlind-Position ermitteln
|
||||
// int activePlayerBeforeSmallBlind = smallBlindPosition;
|
||||
|
||||
// for(i=0; (i<MAX_NUMBER_OF_PLAYERS && !(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6) || i==0; i++) {
|
||||
|
||||
// activePlayerBeforeSmallBlind = (activePlayerBeforeSmallBlind + MAX_NUMBER_OF_PLAYERS - 1 ) % (MAX_NUMBER_OF_PLAYERS);
|
||||
// }
|
||||
|
||||
// myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
|
||||
|
||||
currentPlayersTurnId = (*currentPlayersTurnIt)->getMyUniqueID();
|
||||
|
||||
//highlight active players groupbox and clear action
|
||||
myHand->getGuiInterface()->refreshGroupbox(currentPlayersTurnId,2);
|
||||
myHand->getGuiInterface()->refreshAction(currentPlayersTurnId,0);
|
||||
|
||||
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
|
||||
// ausnahme bei heads up !!! --> TODO
|
||||
// if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind && myHand->getActivePlayerList()->size() >= 3) { firstRound = 0; }
|
||||
// if(myHand->getActivePlayerList()->size() < 3 && (myHand->getPlayerArray()[playersTurn]->getMyID() == dealerPosition || myHand->getPlayerArray()[playersTurn]->getMyID() == smallBlindPosition)) { firstRound = 0; }
|
||||
|
||||
currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
|
||||
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||
@@ -396,11 +221,6 @@ void LocalBeRo::run() {
|
||||
firstRound = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if( currentPlayersTurnId == 0) {
|
||||
// Wir sind dran
|
||||
myHand->getGuiInterface()->meInAction();
|
||||
@@ -413,5 +233,3 @@ void LocalBeRo::run() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,22 +37,12 @@ void LocalBeRoPostRiver::run() {
|
||||
}
|
||||
|
||||
void LocalBeRoPostRiver::postRiverRun() {
|
||||
|
||||
// int i;
|
||||
|
||||
int i;
|
||||
PlayerListConstIterator it_c;
|
||||
PlayerListIterator it;
|
||||
|
||||
//berechnen welcher Spieler gewonnen hat
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
//
|
||||
// if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyCardsValueInt() > highestCardsValue ) {
|
||||
// highestCardsValue = getMyHand()->getPlayerArray()[i]->getMyCardsValueInt();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
//berechnen welcher Spieler gewonnen hat
|
||||
// who is the winner
|
||||
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
|
||||
|
||||
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() > highestCardsValue ) {
|
||||
@@ -60,22 +50,7 @@ void LocalBeRoPostRiver::postRiverRun() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Durchschnittsets des human player ermitteln
|
||||
// getMyHand()->getPlayerArray()[0]->setMyAverageSets(((getMyHand()->getPlayerArray()[0]->getMyRoundStartCash())-(getMyHand()->getPlayerArray()[0]->getMyCash()))/(getMyHand()->getBettingRoundsPlayed()+1));
|
||||
|
||||
// Aggressivität des human player ermitteln
|
||||
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
||||
int potPlayers = 0;
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||
// potPlayers++;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
|
||||
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||
@@ -83,11 +58,6 @@ void LocalBeRoPostRiver::postRiverRun() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
|
||||
// getMyHand()->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && getMyHand()->getPlayerArray()[0]->getMyActiveStatus() && getMyHand()->getPlayerArray()[0]->getMyAction() != PLAYER_ACTION_FOLD);
|
||||
|
||||
|
||||
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
|
||||
it = getMyHand()->getActivePlayerIt(0);
|
||||
if( it != getMyHand()->getActivePlayerList()->end() ) {
|
||||
@@ -96,8 +66,6 @@ void LocalBeRoPostRiver::postRiverRun() {
|
||||
}
|
||||
}
|
||||
|
||||
// cout << "myAggressive: " << getMyHand()->getPlayerArray()[0]->getMyAggressive() << endl;
|
||||
|
||||
// Pot-Verteilung
|
||||
getMyHand()->getBoard()->distributePot();
|
||||
|
||||
@@ -107,279 +75,3 @@ void LocalBeRoPostRiver::postRiverRun() {
|
||||
//starte die Animaionsreihe
|
||||
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
void LocalBeRoPostRiver::distributePot() {
|
||||
|
||||
// int potCalcAllinArray[5][2]; // 0 -> ID , 1 -> AllInCash
|
||||
|
||||
int i, j;
|
||||
|
||||
////////////////////
|
||||
// (1) EINLEITUNG //
|
||||
////////////////////
|
||||
|
||||
// die Potverteilung gliedert sich in mehrere Runden:
|
||||
// in der ersten Runden sucht sich der Winner der BettingRound seinen zustehenden Anteil am Pot raus. das kann alles oder nur ein Teil sein (z.b. wenn er mit wenig allin gegangen ist und der Rest weitergespielt hat)
|
||||
// in den darauffolgenden Verteilungsrunden suchen sich die jeweils nᅵhsten Winner aus dem noch brig gebliebenen Pot ihren zustehenden Anteil raus
|
||||
// die gesamte Potverteilung ist zuende, wenn der Pot leer ist und nichts mehr zu holen ist
|
||||
|
||||
|
||||
/////////////////////
|
||||
// (2) HILFSMITTEL //
|
||||
/////////////////////
|
||||
|
||||
// winnersArray erstellen -> hier werden die winner der jeweiligen Potverteilungsrunden eingetragen
|
||||
int *winnersArray = new int[MAX_NUMBER_OF_PLAYERS];
|
||||
|
||||
// Anzahl der winner in einer Potverteilungsrunde
|
||||
int winnersCounter = 0;
|
||||
|
||||
// dieses Array ermittelt wieviel jeder Spieler wᅵrend der gesamten BettingRound gesetzt hat
|
||||
int *roundSetArray = new int[MAX_NUMBER_OF_PLAYERS];
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// Standardwert fr nicht mehr aktive
|
||||
roundSetArray[i] = 0;
|
||||
// nur fr die Spieler ermitteln, die noch aktiv sind (inkl. der gefoldeten)
|
||||
if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||
roundSetArray[i] = getMyHand()->getPlayerArray()[i]->getMyRoundStartCash()-getMyHand()->getPlayerArray()[i]->getMyCash();
|
||||
}
|
||||
}
|
||||
|
||||
// hier steht der CardsValue der Spieler drin die an der Potverteilung teilnehmen (d.h. aktiv und nicht gefoldet), bei allen anderen steht ne 0
|
||||
int *cardsValueArray = new int[MAX_NUMBER_OF_PLAYERS];
|
||||
int playerWantsPotCounter = 0;
|
||||
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// Standardwert
|
||||
cardsValueArray[i] = 0;
|
||||
if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
// nur bei den Spielen den Kartenwert eintragen, die an der Potverteilung teilnehmen
|
||||
cardsValueArray[i] = getMyHand()->getPlayerArray()[i]->getMyCardsValueInt();
|
||||
playerWantsPotCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
int winner;
|
||||
int highestCardsValueTemp;
|
||||
|
||||
// fr SplitPotBerechnung;
|
||||
int winnersSets;
|
||||
int winnersMaxSet;
|
||||
int winnersPot;
|
||||
bool playerIsWinner;
|
||||
|
||||
|
||||
|
||||
//////////////////////
|
||||
// (3) DIE SCHLEIFE //
|
||||
//////////////////////
|
||||
|
||||
|
||||
// Potverteilungsrunden -> solange noch was aus dem pot zu vergeben ist
|
||||
while(playerWantsPotCounter != 0 ) {
|
||||
|
||||
// highestCardsValueTemp zu Beginn der aktuellen Potverteilungsrunde auf Null setzen
|
||||
highestCardsValueTemp = 0;
|
||||
|
||||
// aktuellen highestCardsValueTemp berechnen, von denen die noch an der Potverteilung teilnehmen
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(cardsValueArray[i] > highestCardsValueTemp ) {
|
||||
highestCardsValueTemp = getMyHand()->getPlayerArray()[i]->getMyCardsValueInt();
|
||||
}
|
||||
}
|
||||
|
||||
// zu Beginn der Potverteilungsrunde die Anzahl der winner auf 0 setzen
|
||||
winnersCounter = 0;
|
||||
// Siegerposition und -anzahl von denen ermitteln, die noch an der Potverteilung teilnehmen
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(cardsValueArray[i] == highestCardsValueTemp ) {
|
||||
winnersArray[winnersCounter] = i;
|
||||
winnersCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// A) nur einer hat aktulle Potverteilungsrunde gewonnen gewonnen
|
||||
// --------------------------------------------------------------
|
||||
if(winnersCounter == 1) {
|
||||
|
||||
// winnerID ist an der ersten Stelle im winnersArray
|
||||
winner = winnersArray[0];
|
||||
|
||||
// Winner ist nicht All In gegangen -> bekommt den gesamten Pot
|
||||
// if(getMyHand()->getPlayerArray()[winner]->getMyAction() != 6) {
|
||||
//
|
||||
// getMyHand()->getPlayerArray()[winner]->setMyCash(getMyHand()->getPlayerArray()[winner]->getMyCash()+getMyHand()->getBoard()->getPot());
|
||||
// getMyHand()->getBoard()->setPot(0);
|
||||
// playerWantsPotCounter = 1;
|
||||
//
|
||||
// }
|
||||
// Winner ist All In gegangen -> von denen die weniger gesetzt oder gefoldet hatten alles nehmen und von denen die mehr gesetzt hatten nur die eigenen Sets nehmen
|
||||
// else {
|
||||
|
||||
// alle Spieler nacheinander durchgehen und prfen von wem man wieviel Geld aus dem Pot bekommt
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
// zuerst prfen ob ein gefoldeter Spieler was gesetzt hatte
|
||||
if(i != winner && getMyHand()->getPlayerArray()[i]->getMyAction() == 1) {
|
||||
|
||||
// diesen Teil aus dem Pot holen
|
||||
getMyHand()->getPlayerArray()[winner]->setMyCash(getMyHand()->getPlayerArray()[winner]->getMyCash()+roundSetArray[i]);
|
||||
// Pot dementsprechend verkleinern
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - roundSetArray[i]);
|
||||
// deren Sets auf Null seztzen -> in den nᅵhsten Potverteilungsrunden nimmt der Winner dann von diesen Spielern 0 Dollar aus dem Pot
|
||||
roundSetArray[i] = 0;
|
||||
|
||||
}
|
||||
|
||||
// nun nur von den Spielern holen, die noch an der Potverteilung teilnehmen und natrlich nicht von einem selber
|
||||
if(i != winner && cardsValueArray[i] != 0) {
|
||||
|
||||
// zuerst alle rauspicken, die weniger oder das gleiche gesetzt hatten
|
||||
if(roundSetArray[winner] >= roundSetArray[i]) {
|
||||
|
||||
// von denen alles holen
|
||||
getMyHand()->getPlayerArray()[winner]->setMyCash(getMyHand()->getPlayerArray()[winner]->getMyCash()+roundSetArray[i]);
|
||||
// Pot dementsprechend verkleinern
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - roundSetArray[i]);
|
||||
// diese Spieler dann von der weiteren Potverteilung ausschlieᅵn
|
||||
cardsValueArray[i] = 0;
|
||||
playerWantsPotCounter--;
|
||||
// deren Sets auf Null seztzen, da sie schon alles abgegeben haben
|
||||
roundSetArray[i] = 0;
|
||||
|
||||
}
|
||||
// nun alle Spieler die mehr gesetzt hatten
|
||||
else {
|
||||
|
||||
// den eigenen Setanteil aus dem Pot holen
|
||||
getMyHand()->getPlayerArray()[winner]->setMyCash(getMyHand()->getPlayerArray()[winner]->getMyCash()+roundSetArray[winner]);
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - roundSetArray[winner]);
|
||||
// den Set des Gegners um den bereits abgenommenen Setanteil verkleinern
|
||||
roundSetArray[i] = roundSetArray[i] - roundSetArray[winner];
|
||||
// diese Spieler nehmen an der weiteren Potverteilung teil
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// // }
|
||||
|
||||
// zum Scluss noch eingenen Set wieder holen
|
||||
getMyHand()->getPlayerArray()[winner]->setMyCash(getMyHand()->getPlayerArray()[winner]->getMyCash()+roundSetArray[winner]);
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - roundSetArray[winner]);
|
||||
// nicht mehr an der weiteren Potverteilung teilnehmen, da man sich alles geholt hat was einem zusteht
|
||||
cardsValueArray[winner] = 0;
|
||||
playerWantsPotCounter--;
|
||||
// eigene Sets auf Null seztzen, da sie eben eingesammelt wurden
|
||||
roundSetArray[winner] = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// B) mehrere haben die aktuelle Potverteilungsrunde gewonnen -> SplitPot
|
||||
// ----------------------------------------------------------------------
|
||||
else {
|
||||
|
||||
// hierfr wird ein temporᅵer WinnersPot erstellt; dort flieᅵn erstmal alle zustehenden Anteile aus dem Pot rauf; am Ende wird dies auf die Winners verteilt
|
||||
winnersPot = 0;
|
||||
// hᅵhster Set aller Winner
|
||||
winnersMaxSet = 0;
|
||||
|
||||
// den hᅵhsten Set aller Winner ermitteln
|
||||
for(i=0; i<winnersCounter; i++) {
|
||||
if(roundSetArray[winnersArray[i]] > winnersMaxSet) winnersMaxSet = roundSetArray[i];
|
||||
}
|
||||
|
||||
// gesamtSet aller Winner
|
||||
winnersSets = 0;
|
||||
for(i=0; i<winnersCounter; i++) {
|
||||
winnersSets += roundSetArray[winnersArray[i]];
|
||||
}
|
||||
|
||||
// alle Spieler nacheinander durchgehen und prfen von wem die Winner wieviel Geld aus dem Pot bekommen
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
|
||||
// prfen ob Spieler i zu den Winnern gehᅵt
|
||||
playerIsWinner = 0;
|
||||
for(j=0; j<winnersCounter; j++) {
|
||||
if(winnersArray[j] == i) playerIsWinner = 1; // -> Spieler i gehᅵt zu den Winnern
|
||||
}
|
||||
|
||||
// zuerst prfen ob ein gefoldeter Spieler was gesetzt hatte
|
||||
if(!playerIsWinner && getMyHand()->getPlayerArray()[i]->getMyAction() == 1) {
|
||||
|
||||
// diesen Teil aus dem Pot holen und dem winnersPot geben
|
||||
winnersPot += roundSetArray[i];
|
||||
// Pot dementsprechend verkleinern
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - roundSetArray[i]);
|
||||
// deren Sets auf Null seztzen -> in den nᅵhsten Potverteilungsrunden nehmen die Winner dann von diesen Spielern 0 Dollar aus dem Pot
|
||||
roundSetArray[i] = 0;
|
||||
|
||||
}
|
||||
|
||||
// nun nur von den Spielern holen, die noch an der Potverteilung teilnehmen und natrlich nicht zu den Winnern gehᅵen
|
||||
if(!playerIsWinner && cardsValueArray[i] != 0) {
|
||||
|
||||
// zuerst alle rauspicken, die weniger oder das gleiche gesetzt hatten
|
||||
if(winnersMaxSet >= roundSetArray[i]) {
|
||||
|
||||
// von denen alles holen
|
||||
winnersPot += roundSetArray[i];
|
||||
// Pot dementsprechend verkleinern
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - roundSetArray[i]);
|
||||
// diese Spieler dann von der weiteren Potverteilung ausschlieᅵn
|
||||
cardsValueArray[i] = 0;
|
||||
playerWantsPotCounter--;
|
||||
// deren Sets auf Null seztzen, da sie schon alles abgegeben haben
|
||||
roundSetArray[i] = 0;
|
||||
|
||||
}
|
||||
// nun alle Spieler die mehr gesetzt hatten
|
||||
else {
|
||||
|
||||
// den eigenen Setanteil aus dem Pot holen
|
||||
winnersPot += winnersMaxSet;
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - winnersMaxSet);
|
||||
// den Set des Gegners um den bereits abgenommenen Setanteil verkleinern
|
||||
roundSetArray[i] = roundSetArray[i] - winnersMaxSet;
|
||||
// diese Spieler nehmen an der weiteren Potverteilung teil
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// zum Schluss noch die eingenen Set aus dem Pot holen
|
||||
winnersPot += winnersSets;
|
||||
getMyHand()->getBoard()->setPot(getMyHand()->getBoard()->getPot() - winnersSets);
|
||||
|
||||
// winnersPot verteilen (anteilmᅵig)
|
||||
for(i=0; i<winnersCounter; i++) {
|
||||
getMyHand()->getPlayerArray()[winnersArray[i]]->setMyCash(getMyHand()->getPlayerArray()[winnersArray[i]]->getMyCash()+((roundSetArray[winnersArray[i]]*winnersPot)/winnersSets));
|
||||
}
|
||||
|
||||
|
||||
for(i=0; i<winnersCounter; i++) {
|
||||
// nicht mehr an der weiteren Potverteilung teilnehmen, da man sich alle Winner dieser Verteilungsrunde ihren Anteil geholt haben
|
||||
cardsValueArray[winnersArray[i]] = 0;
|
||||
playerWantsPotCounter--;
|
||||
// Sets auf Null seztzen, da sie eben eingesammelt wurden
|
||||
roundSetArray[winnersArray[i]] = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(getMyHand()->getBoard()->getPot() != 0) cout << "!!! Pot: " << getMyHand()->getBoard()->getPot() << endl;
|
||||
|
||||
delete[] winnersArray;
|
||||
delete[] roundSetArray;
|
||||
delete[] cardsValueArray;
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@@ -29,183 +29,92 @@ using namespace std;
|
||||
|
||||
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, unsigned dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_PREFLOP)
|
||||
{
|
||||
// PlayerListConstIterator it_c;
|
||||
|
||||
setHighestSet(2*getSmallBlind());
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
LocalBeRoPreflop::~LocalBeRoPreflop()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void LocalBeRoPreflop::run() {
|
||||
|
||||
if(getFirstRun()) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// determine bigBlindPosition -> old: delete
|
||||
// for(bigBlindPositionIt=getMyHand()->getActivePlayerList()->begin(); bigBlindPositionIt!=getMyHand()->getActivePlayerList()->end(); bigBlindPositionIt++) {
|
||||
// if((*bigBlindPositionIt)->getMyButton() == BUTTON_BIG_BLIND) break;
|
||||
// }
|
||||
|
||||
|
||||
// search player in runningPlayerList before first action player -> run() determine next player who will do first action
|
||||
// PlayerListIterator it_1, it_2, it_3;
|
||||
PlayerListIterator it;
|
||||
|
||||
// search bigBlindPosition in runningPlayerList -> old: delete
|
||||
// it_1 = find(getMyHand()->getRunningPlayerList()->begin(), getMyHand()->getRunningPlayerList()->end(), *bigBlindPositionIt);
|
||||
|
||||
// search bigBlindPosition in runningPlayerList
|
||||
PlayerListIterator bigBlindPositionIt = getMyHand()->getRunningPlayerIt(getBigBlindPositionId());
|
||||
|
||||
// more than 2 players are still active -> runningPlayerList is not empty
|
||||
if(getMyHand()->getActivePlayerList()->size() > 2) {
|
||||
|
||||
// bigBlindPlayer not found in runningPlayerList (he is all in) -> bigBlindPlayer is not the running player before first action player
|
||||
if(bigBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
// search smallBlindPosition in runningPlayerList
|
||||
PlayerListIterator smallBlindPositionIt = getMyHand()->getRunningPlayerIt(getSmallBlindPositionId());
|
||||
// if(smallBlindPositionIt == getMyHand()->getActivePlayerList()->begin()) smallBlindPositionIt = getMyHand()->getActivePlayerList()->end();
|
||||
// smallBlindPositionIt--;
|
||||
// it_2 = find(getMyHand()->getRunningPlayerList()->begin(), getMyHand()->getRunningPlayerList()->end(), *smallBlindPositionIt);
|
||||
|
||||
// smallBlindPlayer not found in runningPlayerList (he is all in) -> next active player before smallBlindPlayer is running player before first action player
|
||||
if(smallBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
it = getMyHand()->getActivePlayerIt(getSmallBlindPositionId());
|
||||
if(it == getMyHand()->getActivePlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||
|
||||
PlayerListIterator it;
|
||||
|
||||
// search bigBlindPosition in runningPlayerList
|
||||
PlayerListIterator bigBlindPositionIt = getMyHand()->getRunningPlayerIt(getBigBlindPositionId());
|
||||
|
||||
// more than 2 players are still active -> runningPlayerList is not empty
|
||||
if(getMyHand()->getActivePlayerList()->size() > 2) {
|
||||
|
||||
// bigBlindPlayer not found in runningPlayerList (he is all in) -> bigBlindPlayer is not the running player before first action player
|
||||
if(bigBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
// search smallBlindPosition in runningPlayerList
|
||||
PlayerListIterator smallBlindPositionIt = getMyHand()->getRunningPlayerIt(getSmallBlindPositionId());
|
||||
|
||||
// smallBlindPlayer not found in runningPlayerList (he is all in) -> next active player before smallBlindPlayer is running player before first action player
|
||||
if(smallBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
it = getMyHand()->getActivePlayerIt(getSmallBlindPositionId());
|
||||
if(it == getMyHand()->getActivePlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||
}
|
||||
|
||||
if(it == getMyHand()->getActivePlayerList()->begin()) it = getMyHand()->getActivePlayerList()->end();
|
||||
it--;
|
||||
|
||||
setFirstRoundLastPlayersTurnId( (*it)->getMyUniqueID() );
|
||||
|
||||
}
|
||||
// smallBlindPlayer found in runningPlayerList -> running player before first action player
|
||||
else {
|
||||
setFirstRoundLastPlayersTurnId( getSmallBlindPositionId() );
|
||||
}
|
||||
|
||||
if(it == getMyHand()->getActivePlayerList()->begin()) it = getMyHand()->getActivePlayerList()->end();
|
||||
it--;
|
||||
|
||||
setFirstRoundLastPlayersTurnId( (*it)->getMyUniqueID() );
|
||||
|
||||
|
||||
// it_3 = find(getMyHand()->getRunningPlayerList()->begin(), getMyHand()->getRunningPlayerList()->end(), *it_2);
|
||||
// if(it_3 == getMyHand()->getRunningPlayerList()->end()) {
|
||||
// cout << "ERROR - lastPlayersTurnIt-detection in localBeRoPreflop" << endl;
|
||||
// } else {
|
||||
// setLastPlayersTurnIt(it_3);
|
||||
// }
|
||||
}
|
||||
// smallBlindPlayer found in runningPlayerList -> running player before first action player
|
||||
// bigBlindPlayer found in runningPlayerList -> player before first action player
|
||||
else {
|
||||
setFirstRoundLastPlayersTurnId( getSmallBlindPositionId() );
|
||||
setFirstRoundLastPlayersTurnId( getBigBlindPositionId() );
|
||||
}
|
||||
}
|
||||
// bigBlindPlayer found in runningPlayerList -> player before first action player
|
||||
// heads up -> dealer/smallBlindPlayer is first action player and bigBlindPlayer is player before
|
||||
else {
|
||||
setFirstRoundLastPlayersTurnId( getBigBlindPositionId() );
|
||||
}
|
||||
}
|
||||
// heads up -> dealer/smallBlindPlayer is first action player and bigBlindPlayer is player before
|
||||
else {
|
||||
|
||||
// bigBlindPlayer not found in runningPlayerList (he is all in) -> only smallBlind has to choose fold or call the bigBlindAmount
|
||||
if(bigBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
// search smallBlindPosition in runningPlayerList
|
||||
PlayerListIterator smallBlindPositionIt = getMyHand()->getRunningPlayerIt(getSmallBlindPositionId());
|
||||
|
||||
// smallBlindPlayer not found in runningPlayerList (he is all in) -> no running player -> showdown and no firstRoundLastPlayersTurnId is used
|
||||
if(smallBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
|
||||
// bigBlindPlayer not found in runningPlayerList (he is all in) -> only smallBlind has to choose fold or call the bigBlindAmount
|
||||
if(bigBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
// search smallBlindPosition in runningPlayerList
|
||||
PlayerListIterator smallBlindPositionIt = getMyHand()->getRunningPlayerIt(getSmallBlindPositionId());
|
||||
|
||||
// smallBlindPlayer not found in runningPlayerList (he is all in) -> no running player -> showdown and no firstRoundLastPlayersTurnId is used
|
||||
if(smallBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
}
|
||||
// smallBlindPlayer found in runningPlayerList -> running player before first action player (himself)
|
||||
else {
|
||||
setFirstRoundLastPlayersTurnId( getSmallBlindPositionId() );
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
setFirstRoundLastPlayersTurnId( getBigBlindPositionId() );
|
||||
}
|
||||
// smallBlindPlayer found in runningPlayerList -> running player before first action player (himself)
|
||||
else {
|
||||
setFirstRoundLastPlayersTurnId( getSmallBlindPositionId() );
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
setFirstRoundLastPlayersTurnId( getBigBlindPositionId() );
|
||||
}
|
||||
}
|
||||
|
||||
setCurrentPlayersTurnId( getFirstRoundLastPlayersTurnId() );
|
||||
|
||||
// cout << "playerID constructor beropreflop: " << (*(getCurrentPlayersTurnIt()))->getMyID() << endl;
|
||||
|
||||
|
||||
/////////////// testing
|
||||
|
||||
|
||||
|
||||
|
||||
// it_1 = find(getMyHand()->getRunningPlayerList()->begin(), getMyHand()->getRunningPlayerList()->end(), *bigBlindPositionIt);
|
||||
|
||||
// bigBlindPosition is not all in
|
||||
// if(it!=getMyHand()->getRunningPlayerList()->end()) {
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
// if(it_1!=getMyHand()->getRunningPlayerList()->end()) {
|
||||
// cout << getMyHand()->getMyID() << ": " << "gefunden!" << endl;
|
||||
// cout << "\t PlayerID: " << (*it_1)->getMyID() << endl;
|
||||
// it_2 = it_1;
|
||||
// if(it_1 == getMyHand()->getRunningPlayerList()->begin()) it_1 = getMyHand()->getRunningPlayerList()->end();
|
||||
// it_1--;
|
||||
// cout << "\t PlayerID vor bigBlind: " << (*it_1)->getMyID() << endl;
|
||||
// cout << "\t PlayerID vor bigBlind: " << (*it_2)->getMyID() << endl;
|
||||
// } else {
|
||||
// cout << getMyHand()->getMyID() << ": " << "nicht gefunden" << endl;
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
//////////////// old
|
||||
|
||||
// set first runningPlayer before bigBlindPlayer to playersTurn -> run() determine next one who will do first action
|
||||
// setPlayersTurn((*bigBlindPositionIt)->getMyID());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
setCurrentPlayersTurnId( getFirstRoundLastPlayersTurnId() );
|
||||
|
||||
setFirstRun(false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int i;
|
||||
bool allHighestSet = true;
|
||||
// PlayerListIterator it;
|
||||
PlayerListConstIterator it_c;
|
||||
|
||||
|
||||
|
||||
// test if all running players have same sets (else allHighestSet = false)
|
||||
// check if all running players have same sets (else allHighestSet = false)
|
||||
for(it_c=getMyHand()->getRunningPlayerList()->begin(); it_c!=getMyHand()->getRunningPlayerList()->end(); it_c++) {
|
||||
if(getHighestSet() != (*it_c)->getMySet()) {
|
||||
allHighestSet = false;
|
||||
@@ -214,17 +123,6 @@ void LocalBeRoPreflop::run() {
|
||||
}
|
||||
|
||||
// determine next player
|
||||
|
||||
// cout << "playerID begin preflopRun(): " << (*(getCurrentPlayersTurnIt()))->getMyID() << endl;
|
||||
|
||||
// it++;
|
||||
|
||||
|
||||
|
||||
// cout << "size: " << getMyHand()->getRunningPlayerList()->size() << endl;
|
||||
|
||||
// cout << "currentPlayerID: " << getCurrentPlayersTurnId() << endl;
|
||||
|
||||
PlayerListConstIterator currentPlayersTurnIt = getMyHand()->getRunningPlayerIt( getCurrentPlayersTurnId() );
|
||||
if(currentPlayersTurnIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||
@@ -234,72 +132,6 @@ void LocalBeRoPreflop::run() {
|
||||
if(currentPlayersTurnIt == getMyHand()->getRunningPlayerList()->end()) currentPlayersTurnIt = getMyHand()->getRunningPlayerList()->begin();
|
||||
|
||||
setCurrentPlayersTurnId( (*currentPlayersTurnIt)->getMyUniqueID() );
|
||||
|
||||
// setCurrentPlayersTurnIt(++getCurrentPlayersTurnIt());
|
||||
// if(getCurrentPlayersTurnIt() == getMyHand()->getRunningPlayerList()->end()) setCurrentPlayersTurnIt(getMyHand()->getRunningPlayerList()->begin());
|
||||
|
||||
// if(getCurrentPlayersTurnIt() == getMyHand()->getRunningPlayerList()->end()) cout << "!!!" << endl;
|
||||
|
||||
// cout << "playerID middle preflopRun(): " << (*(getCurrentPlayersTurnIt()))->getMyID() << endl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PlayerListConstIterator currentPlayersTurnConstIt;
|
||||
// exceptions
|
||||
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount is nonfold too -> preflop is over
|
||||
// if(getFirstRound()) {
|
||||
// PlayerListConstIterator bigBlindPositionIt = getMyHand()->getActivePlayerIt(getBigBlindPositionId());
|
||||
// assert(bigBlindPositionIt != getMyHand()->getActivePlayerList()->end());
|
||||
//
|
||||
// currentPlayersTurnConstIt = getMyHand()->getRunningPlayerIt( getCurrentPlayersTurnId() );
|
||||
// assert(currentPlayersTurnConstIt != getMyHand()->getRunningPlayerList()->end());
|
||||
//
|
||||
// int nonFoldPlayerCounter = 0;
|
||||
// for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
|
||||
// if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonFoldPlayerCounter++;
|
||||
// }
|
||||
//
|
||||
// if((*currentPlayersTurnConstIt)->getMyButton() == BUTTON_SMALL_BLIND && (*bigBlindPositionIt)->getMySet() <= getSmallBlind() && nonFoldPlayerCounter == 2) {
|
||||
// setFirstRound(false);
|
||||
// allHighestSet = true;
|
||||
// getMyHand()->setAllInCondition(true);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// determine next player
|
||||
// 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 && (*bigBlindPositionIt)->getMySet() < 2*getSmallBlind()) setFirstRound(false);
|
||||
// // if next player is small blind and only all-in-big-blind with <= 2*smallblind is nonfold too
|
||||
// if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_SMALL_BLIND && (*bigBlindPositionIt)->getMySet() <= getSmallBlind() && getMyHand()->getRunningPlayerList()->size() == 1) {
|
||||
// setFirstRound(false);
|
||||
// allHighestSet = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// cout << "firstRound. " << getFirstRound() << " - allHighestSet: " << allHighestSet << endl;
|
||||
|
||||
// prfen, ob Preflop wirklich dran ist
|
||||
if(!getFirstRound() && allHighestSet) {
|
||||
@@ -308,19 +140,11 @@ void LocalBeRoPreflop::run() {
|
||||
//also gehe in Flop
|
||||
getMyHand()->setCurrentRound(GAME_STATE_FLOP);
|
||||
|
||||
// exception no.1 - see above
|
||||
// if(getMyHand()->getAllInCondition()) getMyHand()->setCurrentRound(GAME_STATE_PREFLOP);;
|
||||
|
||||
//Action loeschen und ActionButtons refresh
|
||||
for(it_c=getMyHand()->getRunningPlayerList()->begin(); it_c!=getMyHand()->getRunningPlayerList()->end(); it_c++) {
|
||||
(*it_c)->setMyAction(PLAYER_ACTION_NONE);
|
||||
}
|
||||
|
||||
//Action loeschen und ActionButtons refresh
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if(getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_ALLIN) getMyHand()->getPlayerArray()[i]->setMyAction(PLAYER_ACTION_NONE);
|
||||
// }
|
||||
|
||||
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||
getMyHand()->getBoard()->collectSets();
|
||||
getMyHand()->getBoard()->collectPot();
|
||||
@@ -333,36 +157,17 @@ void LocalBeRoPreflop::run() {
|
||||
getMyHand()->switchRounds();
|
||||
}
|
||||
else {
|
||||
// Preflop ist wirklich dran
|
||||
|
||||
// falls BigBlind, dann PreflopFirstRound zuende
|
||||
// if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND) setFirstRound(0);
|
||||
|
||||
// lastPlayersTurn -> PreflopFirstRound is over
|
||||
// if( (*(getCurrentPlayersTurnIt())) == (*(getLastPlayersTurnIt())) ) {
|
||||
// setFirstRound(false);
|
||||
// }
|
||||
|
||||
// lastPlayersTurn -> PreflopFirstRound is over
|
||||
if( getCurrentPlayersTurnId() == getFirstRoundLastPlayersTurnId() ) {
|
||||
setFirstRound(false);
|
||||
}
|
||||
|
||||
|
||||
// getMyHand()->getPlayerArray()[getPlayersTurn()]->setMyTurn(1);
|
||||
|
||||
currentPlayersTurnIt = getMyHand()->getRunningPlayerIt( getCurrentPlayersTurnId() );
|
||||
if(currentPlayersTurnIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||
}
|
||||
(*currentPlayersTurnIt)->setMyTurn(true);
|
||||
|
||||
// (*(getCurrentPlayersTurnIt()))->setMyTurn(true);
|
||||
|
||||
//highlight active players groupbox and clear action
|
||||
// getMyHand()->getGuiInterface()->refreshGroupbox(getPlayersTurn(),2);
|
||||
// getMyHand()->getGuiInterface()->refreshAction(getPlayersTurn(),PLAYER_ACTION_NONE);
|
||||
|
||||
//highlight active players groupbox and clear action
|
||||
getMyHand()->getGuiInterface()->refreshGroupbox( getCurrentPlayersTurnId() , 2 );
|
||||
getMyHand()->getGuiInterface()->refreshAction( getCurrentPlayersTurnId() , PLAYER_ACTION_NONE );
|
||||
@@ -374,7 +179,6 @@ void LocalBeRoPreflop::run() {
|
||||
}
|
||||
else {
|
||||
//Gegner sind dran
|
||||
// cout << "NextPlayerSpeed3 start" << endl;
|
||||
getMyHand()->getGuiInterface()->beRoAnimation2(getMyBeRoID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,17 +26,15 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
LocalBoard::LocalBoard() : BoardInterface(), /*playerArray(0),*/ currentHand(0), pot(0), sets(0)
|
||||
LocalBoard::LocalBoard() : BoardInterface(), currentHand(0), pot(0), sets(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LocalBoard::~LocalBoard()
|
||||
{
|
||||
}
|
||||
|
||||
void LocalBoard::setPlayerLists(/*std::vector<boost::shared_ptr<PlayerInterface> > sl_old, */PlayerList sl, PlayerList apl, PlayerList rpl) {
|
||||
// playerArray = sl_old; // delete
|
||||
void LocalBoard::setPlayerLists(PlayerList sl, PlayerList apl, PlayerList rpl) {
|
||||
seatsList = sl;
|
||||
activePlayerList = apl;
|
||||
runningPlayerList = rpl;
|
||||
@@ -47,22 +45,18 @@ void LocalBoard::setHand(HandInterface* br) { currentHand = br; }
|
||||
void LocalBoard::collectSets() {
|
||||
|
||||
sets = 0;
|
||||
// int i;
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) sets += playerArray[i]->getMySet(); //delete
|
||||
|
||||
PlayerListConstIterator it_c;
|
||||
for(it_c=seatsList->begin(); it_c!=seatsList->end(); it_c++) {
|
||||
sets += (*it_c)->getMySet();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void LocalBoard::collectPot() {
|
||||
// int i;
|
||||
|
||||
pot += sets;
|
||||
sets = 0;
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++){ playerArray[i]->setMySetNull(); }
|
||||
|
||||
PlayerListIterator it;
|
||||
for(it=seatsList->begin(); it!=seatsList->end(); it++) {
|
||||
@@ -79,16 +73,6 @@ void LocalBoard::distributePot() {
|
||||
PlayerListIterator it;
|
||||
PlayerListConstIterator it_c;
|
||||
|
||||
// filling player sets vector
|
||||
// vector<int> playerSets;
|
||||
// for(i=0; i<(size_t)MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if(playerArray[i]->getMyActiveStatus()) {
|
||||
// playerSets.push_back(((playerArray[i]->getMyRoundStartCash())-(playerArray[i]->getMyCash())));
|
||||
// } else {
|
||||
// playerSets.push_back(0);
|
||||
// }
|
||||
// }
|
||||
|
||||
// filling player sets vector
|
||||
vector<int> playerSets;
|
||||
for(it_c=seatsList->begin(); it_c!=seatsList->end(); it_c++) {
|
||||
@@ -99,7 +83,6 @@ void LocalBoard::distributePot() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// sort player sets asc
|
||||
vector<int> playerSetsSort = playerSets;
|
||||
sort(playerSetsSort.begin(), playerSetsSort.end());
|
||||
@@ -130,30 +113,14 @@ void LocalBoard::distributePot() {
|
||||
potLevel.push_back((playerSetsSort.size()-i)*potLevel[0]);
|
||||
|
||||
// determine level highestCardsValue
|
||||
// for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
// if(playerArray[j]->getMyCardsValueInt() > highestCardsValue && playerArray[j]->getMyActiveStatus() && playerArray[j]->getMyAction() != PLAYER_ACTION_FOLD && playerSets[j] >= potLevel[0]) {
|
||||
// highestCardsValue = playerArray[j]->getMyCardsValueInt();
|
||||
// }
|
||||
// }
|
||||
|
||||
// determine level highestCardsValue
|
||||
j=0;
|
||||
for(it_c=seatsList->begin(); it_c!=seatsList->end(); it_c++,j++) {
|
||||
for(it_c=seatsList->begin(), j=0; it_c!=seatsList->end(); it_c++,j++) {
|
||||
if((*it_c)->getMyActiveStatus() && (*it_c)->getMyCardsValueInt() > highestCardsValue && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && playerSets[j] >= potLevel[0]) {
|
||||
highestCardsValue = (*it_c)->getMyCardsValueInt();
|
||||
}
|
||||
}
|
||||
|
||||
// level winners
|
||||
// for(j=0; j<MAX_NUMBER_OF_PLAYERS; j++) {
|
||||
// if(highestCardsValue == playerArray[j]->getMyCardsValueInt() && playerArray[j]->getMyActiveStatus() && playerArray[j]->getMyAction() != PLAYER_ACTION_FOLD && playerSets[j] >= potLevel[0]) {
|
||||
// potLevel.push_back(playerArray[j]->getMyID());
|
||||
// }
|
||||
// }
|
||||
|
||||
// level winners
|
||||
j=0;
|
||||
for(it_c=seatsList->begin(); it_c!=seatsList->end(); it_c++,j++) {
|
||||
for(it_c=seatsList->begin(), j=0; it_c!=seatsList->end(); it_c++,j++) {
|
||||
if((*it_c)->getMyActiveStatus() && highestCardsValue == (*it_c)->getMyCardsValueInt() && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && playerSets[j] >= potLevel[0]) {
|
||||
potLevel.push_back((*it_c)->getMyUniqueID());
|
||||
}
|
||||
@@ -169,9 +136,6 @@ void LocalBoard::distributePot() {
|
||||
mod = (potLevel[1])%winnerCount;
|
||||
// pot level sum divisible by winnerCount
|
||||
if(mod == 0) {
|
||||
// for(j=2; j<potLevel.size(); j++) {
|
||||
// playerArray[potLevel[j]]->setMyCash(playerArray[potLevel[j]]->getMyCash() + ((potLevel[1])/winnerCount));
|
||||
// }
|
||||
|
||||
for(j=2; j<potLevel.size(); j++) {
|
||||
it = currentHand->getSeatIt(potLevel[j]);
|
||||
@@ -207,13 +171,6 @@ void LocalBoard::distributePot() {
|
||||
|
||||
}
|
||||
|
||||
// if(j<mod) {
|
||||
// playerArray[winnerPointer]->setMyCash(playerArray[winnerPointer]->getMyCash() + (int)((potLevel[1])/winnerCount) + 1);
|
||||
// } else {
|
||||
// playerArray[winnerPointer]->setMyCash(playerArray[winnerPointer]->getMyCash() + (int)((potLevel[1])/winnerCount));
|
||||
// }
|
||||
|
||||
|
||||
it = currentHand->getSeatIt(winnerPointer);
|
||||
if(it == seatsList->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_SEAT_NOT_FOUND);
|
||||
@@ -260,18 +217,12 @@ void LocalBoard::distributePot() {
|
||||
if(pot!=0) cout << "distributePot-ERROR: Pot = " << pot << endl;
|
||||
|
||||
int sum = 0;
|
||||
// for(i=0; i<(size_t)MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if(playerArray[i]->getMyActiveStatus())
|
||||
// sum += playerArray[i]->getMyCash();
|
||||
// }
|
||||
|
||||
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
sum += (*it_c)->getMyCash();
|
||||
}
|
||||
|
||||
|
||||
if(sum != (currentHand->getStartQuantityPlayers() * currentHand->getStartCash()))
|
||||
cout << "distributePot-ERROR: PlayersSumCash = " << sum << endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
LocalBoard();
|
||||
~LocalBoard();
|
||||
|
||||
void setPlayerLists(/*std::vector<boost::shared_ptr<PlayerInterface> >,*/ PlayerList, PlayerList, PlayerList);
|
||||
void setPlayerLists(PlayerList, PlayerList, PlayerList);
|
||||
void setHand(HandInterface*);
|
||||
|
||||
void setMyCards(int* theValue) { int i; for(i=0; i<5; i++) myCards[i] = theValue[i]; }
|
||||
@@ -55,7 +55,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
// std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // delete
|
||||
PlayerList seatsList;
|
||||
PlayerList activePlayerList;
|
||||
PlayerList runningPlayerList;
|
||||
|
||||
@@ -42,7 +42,7 @@ LocalEngineFactory::~LocalEngineFactory()
|
||||
}
|
||||
|
||||
|
||||
HandInterface* LocalEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, /*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) { return new LocalHand(f, g, b, /*sl_old,*/ sl, apl, rpl, id, sP, dP, sB, sC); }
|
||||
HandInterface* LocalEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) { return new LocalHand(f, g, b, sl, apl, rpl, id, sP, dP, sB, sC); }
|
||||
|
||||
BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
LocalEngineFactory(ConfigFile*);
|
||||
~LocalEngineFactory();
|
||||
|
||||
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, /*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||
BoardInterface* createBoard();
|
||||
boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB);
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, /*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
|
||||
: myFactory(f), myGui(g), myBoard(b), /*playerArray(sl_old),*/ seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(false),
|
||||
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
|
||||
: myFactory(f), myGui(g), myBoard(b), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(false),
|
||||
cardsShown(false), bettingRoundsPlayed(0)
|
||||
{
|
||||
|
||||
@@ -41,25 +41,13 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
||||
|
||||
myBoard->setHand(this);
|
||||
|
||||
// for(i=0; i<startQuantityPlayers; i++) {
|
||||
// playerArray[i]->setHand(this);
|
||||
// // myFlipCards auf 0 setzen
|
||||
// playerArray[i]->setMyCardsFlip(0, 0);
|
||||
// }
|
||||
|
||||
for(it=seatsList->begin(); it!=seatsList->end(); it++) {
|
||||
(*it)->setHand(this);
|
||||
// myFlipCards auf 0 setzen
|
||||
// set myFlipCards 0
|
||||
(*it)->setMyCardsFlip(0, 0);
|
||||
}
|
||||
|
||||
|
||||
// roundStartCashArray fllen
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// playerArray[i]->setMyRoundStartCash(playerArray[i]->getMyCash());
|
||||
// }
|
||||
|
||||
// Karten generieren und Board sowie Player zuweisen
|
||||
// generate cards and assign to board and player
|
||||
int *cardsArray = new int[2*activePlayerList->size()+5];
|
||||
Tools::getRandNumber(0, 51, 2*activePlayerList->size()+5, cardsArray, 1);
|
||||
int tempBoardArray[5];
|
||||
@@ -88,14 +76,14 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
||||
(*it)->setMyBestHandPosition(bestHandPos);
|
||||
(*it)->setMyRoundStartCash((*it)->getMyCash());
|
||||
|
||||
// myBestHandPosition auf Fehler ueberpruefen
|
||||
// error-check
|
||||
for(j=0; j<5; j++) {
|
||||
if (bestHandPos[j] == -1) {
|
||||
cout << "ERROR getMyBestHandPosition in localhand.cpp" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// sBluff für alle aktiver Spieler außer human player setzen --> TODO for ai-player in internet
|
||||
// set sBluff for all players --> TODO for ai-player in internet
|
||||
if((*it)->getMyID() != 0) {
|
||||
Tools::getRandNumber(1,100,1,&sBluff,0);
|
||||
(*it)->setSBluff(sBluff);
|
||||
@@ -327,7 +315,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
||||
|
||||
// ----------------------------------------
|
||||
|
||||
// Dealer, SB, BB bestimmen
|
||||
// determine dealer, SB, BB
|
||||
assignButtons();
|
||||
|
||||
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
|
||||
@@ -351,13 +339,13 @@ void LocalHand::start() {
|
||||
else { cout << "Log Error: cannot find sBID or bBID" << "\n"; }
|
||||
myGui->flushLogAtHand();
|
||||
|
||||
// Karten austeilen
|
||||
// deal cards
|
||||
myGui->dealHoleCards();
|
||||
|
||||
getBoard()->collectSets();
|
||||
getGuiInterface()->refreshPot();
|
||||
|
||||
//Rundenwechsel | beim ersten Durchlauf --> Preflop starten
|
||||
// change rounds | first start preflop
|
||||
myGui->nextPlayerAnimation();
|
||||
}
|
||||
|
||||
@@ -367,18 +355,12 @@ void LocalHand::assignButtons() {
|
||||
PlayerListIterator it;
|
||||
PlayerListConstIterator it_c;
|
||||
|
||||
// alle Buttons loeschen
|
||||
// for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
|
||||
|
||||
// alle Buttons loeschen
|
||||
// delete all buttons
|
||||
for (it=seatsList->begin(); it!=seatsList->end(); it++) {
|
||||
(*it)->setMyButton(BUTTON_NONE);
|
||||
}
|
||||
|
||||
// DealerButton zuweisen
|
||||
// playerArray[dealerPosition]->setMyButton(1);
|
||||
|
||||
// DealerButton zuweisen
|
||||
// assign dealer button
|
||||
it = getSeatIt(dealerPosition);
|
||||
if(it == seatsList->end()) {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_SEAT_NOT_FOUND);
|
||||
@@ -386,32 +368,6 @@ void LocalHand::assignButtons() {
|
||||
(*it)->setMyButton(BUTTON_DEALER);
|
||||
|
||||
|
||||
// assign Small Blind next to dealer. ATTENTION: in heads up it is big blind
|
||||
// i = dealerPosition;
|
||||
//
|
||||
// for(j=0; (j<MAX_NUMBER_OF_PLAYERS && !(playerArray[i]->getMyActiveStatus())) || j==0; j++) {
|
||||
//
|
||||
// i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
// if(playerArray[i]->getMyActiveStatus()) {
|
||||
// if(activePlayerList->size() > 2) playerArray[i]->setMyButton(2); //small blind normal
|
||||
// else playerArray[i]->setMyButton(3); //big blind in heads up
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// assign big blind next to small blind. ATTENTION: in heads up it is small blind
|
||||
// for(j=0; (j<MAX_NUMBER_OF_PLAYERS && !(playerArray[i]->getMyActiveStatus())) || j==0; j++) {
|
||||
//
|
||||
// i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||
// if(playerArray[i]->getMyActiveStatus()) {
|
||||
// if(activePlayerList->size() > 2) playerArray[i]->setMyButton(3); //big blind normal
|
||||
// else playerArray[i]->setMyButton(2); //small blind in heads up
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// assign Small Blind next to dealer. ATTENTION: in heads up it is big blind
|
||||
// assign big blind next to small blind. ATTENTION: in heads up it is small blind
|
||||
bool nextActivePlayerFound = false;
|
||||
@@ -445,24 +401,6 @@ void LocalHand::assignButtons() {
|
||||
throw LocalException(__FILE__, __LINE__, ERR_NEXT_ACTIVE_PLAYER_NOT_FOUND);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//do sets --> TODO switch?
|
||||
for (it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); it_c++) {
|
||||
|
||||
@@ -475,8 +413,6 @@ void LocalHand::assignButtons() {
|
||||
(*it_c)->setMySet((*it_c)->getMyCash());
|
||||
// 1 to do not log this
|
||||
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
|
||||
// delete this player from runningPlayerList
|
||||
// it_c = runningPlayerList->erase(it_c);
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -493,8 +429,6 @@ void LocalHand::assignButtons() {
|
||||
(*it_c)->setMySet((*it_c)->getMyCash());
|
||||
// 1 to do not log this
|
||||
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1);
|
||||
// delete this player from runningPlayerList
|
||||
// it_c = runningPlayerList->erase(it_c);
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -507,8 +441,6 @@ void LocalHand::assignButtons() {
|
||||
|
||||
void LocalHand::switchRounds() {
|
||||
|
||||
// cout << "playerID begin switchRounds(): " << getCurrentBeRo()->get
|
||||
|
||||
PlayerListIterator it, it_1;
|
||||
PlayerListConstIterator it_c;
|
||||
|
||||
@@ -530,51 +462,38 @@ void LocalHand::switchRounds() {
|
||||
}
|
||||
}
|
||||
|
||||
// Anzahl der Spieler ermitteln, welche All In sind
|
||||
// determine number of all in players
|
||||
int allInPlayersCounter = 0;
|
||||
for (it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
if ((*it_c)->getMyAction() == PLAYER_ACTION_ALLIN) allInPlayersCounter++;
|
||||
}
|
||||
|
||||
// cout << "allInPlayersCounter: " << allInPlayersCounter << endl;
|
||||
|
||||
// TODO -> runningPlayerList.size()
|
||||
// determine number of non-fold players
|
||||
int nonFoldPlayerCounter = 0;
|
||||
for (it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonFoldPlayerCounter++;
|
||||
}
|
||||
|
||||
// cout << "nonFoldPlayerCounter: " << nonFoldPlayerCounter << endl;
|
||||
|
||||
//wenn nur noch einer nicht-folded dann gleich den Pot verteilen
|
||||
// if only one player non-fold -> distribute pot
|
||||
if(nonFoldPlayerCounter==1) {
|
||||
myBoard->collectPot();
|
||||
myGui->refreshPot();
|
||||
myGui->refreshSet();
|
||||
currentRound = 4;
|
||||
}
|
||||
// prfen der All In Kondition
|
||||
// fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein
|
||||
|
||||
// check for all in condition
|
||||
// for all in condition at least two active players have to remain
|
||||
else {
|
||||
|
||||
// 1) wenn alle All In
|
||||
// 1) all players all in
|
||||
if(allInPlayersCounter == nonFoldPlayerCounter) {
|
||||
allInCondition = true;
|
||||
}
|
||||
|
||||
// 2) alle bis auf einen All In und der hat HighestSet
|
||||
// 2) all players but one all in and he has highest set
|
||||
if(allInPlayersCounter+1 == nonFoldPlayerCounter) {
|
||||
|
||||
// TODO -> runningPlayerList s.u.
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
//
|
||||
// if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMySet() >= myBeRo[currentRound]->getHighestSet()) {
|
||||
// allInCondition = 1;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
for(it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); it_c++) {
|
||||
|
||||
if((*it_c)->getMySet() >= myBeRo[currentRound]->getHighestSet()) {
|
||||
@@ -583,54 +502,34 @@ void LocalHand::switchRounds() {
|
||||
|
||||
}
|
||||
|
||||
// if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[currentRound]->getHighestSet() ) {
|
||||
// allInCondition = 1;
|
||||
// }
|
||||
|
||||
// // HeadsUp-Ausnahme -> spieler ermitteln, der all in ist und als bb nur weniger als sb setzen konnte
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
//
|
||||
// if(activePlayerList->size()==2 && playerArray[i]->getMyAction() == 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMyButton()==3 && playerArray[i]->getMySet()<=smallBlind) {
|
||||
// allInCondition = 1;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// exception
|
||||
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount and other all-in players with less than small blind are nonfold too -> preflop is over
|
||||
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[currentRound]->getSmallBlindPositionId());
|
||||
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[currentRound]->getBigBlindPositionId());
|
||||
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && currentRound == GAME_STATE_PREFLOP && myBeRo[currentRound]->getFirstRound()) {
|
||||
// determine player who are all in with less than small blind amount
|
||||
int tempCounter = 0;
|
||||
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
if((*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMySet() <= smallBlind) {
|
||||
tempCounter++;
|
||||
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[currentRound]->getSmallBlindPositionId());
|
||||
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[currentRound]->getBigBlindPositionId());
|
||||
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && currentRound == GAME_STATE_PREFLOP && myBeRo[currentRound]->getFirstRound()) {
|
||||
// determine player who are all in with less than small blind amount
|
||||
int tempCounter = 0;
|
||||
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
if((*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMySet() <= smallBlind) {
|
||||
tempCounter++;
|
||||
}
|
||||
}
|
||||
if( (*bigBlindIt_c)->getMySet() <= smallBlind && tempCounter == allInPlayersCounter) {
|
||||
allInCondition = true;
|
||||
}
|
||||
}
|
||||
if( (*bigBlindIt_c)->getMySet() <= smallBlind && tempCounter == allInPlayersCounter) {
|
||||
allInCondition = true;
|
||||
|
||||
// no.2: heads up -> detect player who is all in and bb but could set less than sb
|
||||
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
|
||||
if(activePlayerList->size()==2 && (*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMyButton()==BUTTON_BIG_BLIND && (*it_c)->getMySet()<=smallBlind) {
|
||||
allInCondition = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// HeadsUp-Ausnahme -> spieler ermitteln, der all in ist und als bb nur weniger als sb setzen konnte
|
||||
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
|
||||
|
||||
if(activePlayerList->size()==2 && (*it_c)->getMyAction() == PLAYER_ACTION_ALLIN && (*it_c)->getMyButton()==BUTTON_BIG_BLIND && (*it_c)->getMySet()<=smallBlind) {
|
||||
allInCondition = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// beim Vorliegen einer All In Kondition -> Ausfhrung einer Sonderprozedur
|
||||
// special routine
|
||||
if(allInCondition) {
|
||||
myBoard->collectPot();
|
||||
myGui->refreshPot();
|
||||
@@ -650,12 +549,6 @@ void LocalHand::switchRounds() {
|
||||
|
||||
}
|
||||
|
||||
//unhighlight current players groupbox
|
||||
// if(playerArray[lastPlayersTurn]->getMyActiveStatus() == 1) myGui->refreshGroupbox(lastPlayersTurn,1);
|
||||
|
||||
|
||||
|
||||
|
||||
//unhighlight current players groupbox
|
||||
it_c = getActivePlayerIt(lastPlayersTurn);
|
||||
if( it_c != activePlayerList->end() ) {
|
||||
@@ -663,34 +556,29 @@ void LocalHand::switchRounds() {
|
||||
myGui->refreshGroupbox(lastPlayersTurn,1);
|
||||
}
|
||||
|
||||
|
||||
myGui->refreshGameLabels((GameState)getCurrentRound());
|
||||
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
|
||||
//
|
||||
|
||||
|
||||
// cout << "NextPlayerSpeed2 start" << endl;
|
||||
switch(currentRound) {
|
||||
case 0: {
|
||||
// Preflop starten
|
||||
// start preflop
|
||||
myGui->preflopAnimation1();
|
||||
} break;
|
||||
case 1: {
|
||||
// Flop starten
|
||||
// start flop
|
||||
myGui->flopAnimation1();
|
||||
} break;
|
||||
case 2: {
|
||||
// Turn starten
|
||||
// start turn
|
||||
myGui->turnAnimation1();
|
||||
|
||||
} break;
|
||||
case 3: {
|
||||
// River starten
|
||||
// start river
|
||||
myGui->riverAnimation1();
|
||||
|
||||
} break;
|
||||
case 4: {
|
||||
// PostRiver starten
|
||||
// start post river
|
||||
myGui->postRiverAnimation1();
|
||||
|
||||
} break;
|
||||
@@ -736,15 +624,11 @@ PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const {
|
||||
|
||||
for(it=runningPlayerList->begin(); it!=runningPlayerList->end(); it++) {
|
||||
|
||||
// cout << (*it)->getMyUniqueID() << " ";
|
||||
|
||||
if((*it)->getMyUniqueID() == uniqueId) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// cout << endl;
|
||||
|
||||
return it;
|
||||
|
||||
}
|
||||
|
||||
@@ -34,12 +34,11 @@
|
||||
|
||||
class LocalHand : public HandInterface{
|
||||
public:
|
||||
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, /*std::vector<boost::shared_ptr<PlayerInterface> >,*/ PlayerList, PlayerList, PlayerList, int, int, unsigned, int, int);
|
||||
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, PlayerList, PlayerList, PlayerList, int, int, unsigned, int, int);
|
||||
~LocalHand();
|
||||
|
||||
void start();
|
||||
|
||||
// std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const { return playerArray; }
|
||||
PlayerList getSeatsList() const {return seatsList;}
|
||||
PlayerList getActivePlayerList() const {return activePlayerList;}
|
||||
PlayerList getRunningPlayerList() const {return runningPlayerList;}
|
||||
@@ -97,7 +96,6 @@ private:
|
||||
GuiInterface *myGui;
|
||||
BoardInterface *myBoard;
|
||||
|
||||
// std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // delete
|
||||
PlayerList seatsList;
|
||||
PlayerList activePlayerList;
|
||||
PlayerList runningPlayerList;
|
||||
@@ -106,7 +104,7 @@ private:
|
||||
|
||||
int myID;
|
||||
int startQuantityPlayers;
|
||||
unsigned dealerPosition; // -1 -> neutral
|
||||
unsigned dealerPosition;
|
||||
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
||||
int smallBlind;
|
||||
int startCash;
|
||||
|
||||
@@ -1079,16 +1079,6 @@ void LocalPlayer::preflopEngine() {
|
||||
|
||||
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||
// int aggValue = (int)(((currentHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/currentHand->getActivePlayerList()->size())*21.0);
|
||||
//
|
||||
// if(currentHand->getPlayerArray()[0]->getMyActiveStatus() && currentHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||
// myNiveau[0] -= aggValue;
|
||||
// myNiveau[2] -= aggValue;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||
it_c = currentHand->getActivePlayerIt(0);
|
||||
if( it_c != currentHand->getActivePlayerList()->end() ) {
|
||||
@@ -1394,15 +1384,6 @@ void LocalPlayer::flopEngine() {
|
||||
int individualHighestSet = currentHand->getCurrentBeRo()->getHighestSet();
|
||||
if(individualHighestSet > myCash) individualHighestSet = myCash;
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
||||
// int aggValue = (int)(((currentHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/currentHand->getActivePlayerList()->size())*21.0);
|
||||
//
|
||||
// if(currentHand->getPlayerArray()[0]->getMyActiveStatus() && currentHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||
// for(i=0; i<3; i++) {
|
||||
// myNiveau[i] -= aggValue;
|
||||
// }
|
||||
// }
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||
it_c = currentHand->getActivePlayerIt(0);
|
||||
if( it_c != currentHand->getActivePlayerList()->end() ) {
|
||||
@@ -2032,17 +2013,6 @@ void LocalPlayer::turnEngine() {
|
||||
// 3. Call -- Raise
|
||||
myNiveau[2] = 69 + myDude4/* - 6*(currentHand->getActivePlayerList().size() - 2)*/;
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
||||
// int aggValue = (int)(((currentHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/currentHand->getActivePlayerList()->size())*21.0);
|
||||
//
|
||||
// if(currentHand->getPlayerArray()[0]->getMyActiveStatus() && currentHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||
// for(i=0; i<3; i++) {
|
||||
// myNiveau[i] -= aggValue;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||
it_c = currentHand->getActivePlayerIt(0);
|
||||
if( it_c != currentHand->getActivePlayerList()->end() ) {
|
||||
@@ -2436,16 +2406,6 @@ void LocalPlayer::riverEngine() {
|
||||
// 3. Call -- Raise
|
||||
myNiveau[2] = 69 + myDude4/* - 6*(currentHand->getActivePlayerList().size() - 2)*/;
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
||||
// int aggValue = (int)(((currentHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/currentHand->getActivePlayerList()->size())*21.0);
|
||||
//
|
||||
// if(currentHand->getPlayerArray()[0]->getMyActiveStatus() && currentHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||
// for(i=0; i<3; i++) {
|
||||
// myNiveau[i] -= aggValue;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||
it_c = currentHand->getActivePlayerIt(0);
|
||||
if( it_c != currentHand->getActivePlayerList()->end() ) {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
using namespace std;
|
||||
|
||||
ClientBoard::ClientBoard()
|
||||
: /*playerArray(0),*/ currentHand(0), pot(0), sets(0)
|
||||
: currentHand(0), pot(0), sets(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,10 +34,9 @@ ClientBoard::~ClientBoard()
|
||||
}
|
||||
|
||||
void
|
||||
ClientBoard::setPlayerLists(/*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl)
|
||||
ClientBoard::setPlayerLists(PlayerList sl, PlayerList apl, PlayerList rpl)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||
// playerArray = sl_old; // delete
|
||||
seatsList = sl;
|
||||
activePlayerList = apl;
|
||||
runningPlayerList = rpl;
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
ClientBoard();
|
||||
~ClientBoard();
|
||||
|
||||
void setPlayerLists(/*std::vector<boost::shared_ptr<PlayerInterface> >,*/ PlayerList, PlayerList, PlayerList);
|
||||
void setPlayerLists(PlayerList, PlayerList, PlayerList);
|
||||
void setHand(HandInterface*);
|
||||
|
||||
void setMyCards(int* theValue);
|
||||
@@ -55,7 +55,6 @@ public:
|
||||
private:
|
||||
mutable boost::recursive_mutex m_syncMutex;
|
||||
|
||||
// std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // delete
|
||||
PlayerList seatsList;
|
||||
PlayerList activePlayerList;
|
||||
PlayerList runningPlayerList;
|
||||
|
||||
@@ -35,9 +35,9 @@ ClientEngineFactory::~ClientEngineFactory()
|
||||
}
|
||||
|
||||
|
||||
HandInterface* ClientEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, /*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||
HandInterface* ClientEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||
{
|
||||
return new ClientHand(f, g, b, /*sl_old,*/ sl, apl, rpl, id, sP, dP, sB, sC);
|
||||
return new ClientHand(f, g, b, sl, apl, rpl, id, sP, dP, sB, sC);
|
||||
}
|
||||
|
||||
BoardInterface* ClientEngineFactory::createBoard()
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
ClientEngineFactory();
|
||||
~ClientEngineFactory();
|
||||
|
||||
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, /*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||
BoardInterface* createBoard();
|
||||
boost::shared_ptr<PlayerInterface> createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
||||
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB);
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, /*std::vector<boost::shared_ptr<PlayerInterface> > sl_old,*/ PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||
: myFactory(f), myGui(g), myBoard(b), /*playerArray(sl_old),*/ seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0),
|
||||
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||
: myFactory(f), myGui(g), myBoard(b), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0),
|
||||
smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(0),
|
||||
cardsShown(false), bettingRoundsPlayed(0)
|
||||
{
|
||||
@@ -67,12 +67,6 @@ ClientHand::start()
|
||||
{
|
||||
}
|
||||
|
||||
// std::vector<boost::shared_ptr<PlayerInterface> >
|
||||
// ClientHand::getPlayerArray() const
|
||||
// {
|
||||
// return playerArray;
|
||||
// }
|
||||
|
||||
PlayerList
|
||||
ClientHand::getSeatsList() const
|
||||
{
|
||||
|
||||
@@ -32,12 +32,11 @@
|
||||
class ClientHand : public HandInterface
|
||||
{
|
||||
public:
|
||||
ClientHand ( boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, /*std::vector<boost::shared_ptr<PlayerInterface> >,*/ PlayerList, PlayerList, PlayerList , int, int, int, int, int );
|
||||
ClientHand ( boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, PlayerList, PlayerList, PlayerList , int, int, int, int, int );
|
||||
~ClientHand();
|
||||
|
||||
void start();
|
||||
|
||||
// std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const;
|
||||
PlayerList getSeatsList() const;
|
||||
PlayerList getActivePlayerList() const;
|
||||
PlayerList getRunningPlayerList() const;
|
||||
@@ -97,7 +96,6 @@ class ClientHand : public HandInterface
|
||||
GuiInterface *myGui;
|
||||
BoardInterface *myBoard;
|
||||
|
||||
// std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // delete
|
||||
PlayerList seatsList;
|
||||
PlayerList activePlayerList;
|
||||
PlayerList runningPlayerList;
|
||||
|
||||
Reference in New Issue
Block a user