adds activePlayerList and runningPlayerList (II)

This commit is contained in:
doitux
2007-09-24 10:02:17 +00:00
parent 84c857cbff
commit d03f114b46
27 changed files with 132 additions and 189 deletions
+4 -4
View File
@@ -13,8 +13,8 @@
using namespace std;
LocalBeRo::LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), actualQuantityPlayers(qP), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), firstRun(1), firstRound(1), firstHeadsUpRound(1), playersTurn(dP), logBoardCardsDone(0)
LocalBeRo::LocalBeRo(HandInterface* hi, int id, int dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), firstRun(1), firstRound(1), firstHeadsUpRound(1), playersTurn(dP), logBoardCardsDone(0)
{
int i;
@@ -145,8 +145,8 @@ void LocalBeRo::run() {
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
// ausnahme bei heads up !!! --> TODO
if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind && myHand->getActualQuantityPlayers() >= 3) { firstRound = 0; }
if(myHand->getActualQuantityPlayers() < 3 && (myHand->getPlayerArray()[playersTurn]->getMyID() == dealerPosition || myHand->getPlayerArray()[playersTurn]->getMyID() == smallBlindPosition)) { firstRound = 0; }
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; }
if(playersTurn == 0) {
// Wir sind dran
+1 -2
View File
@@ -24,7 +24,7 @@
*/
class LocalBeRo : public BeRoInterface{
public:
LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS);
LocalBeRo(HandInterface* hi, int id, int dP, int sB, GameState gS);
~LocalBeRo();
GameState getMyBeRoID() const { return myBeRoID; }
@@ -77,7 +77,6 @@ private:
const GameState myBeRoID;
int myID;
int actualQuantityPlayers;
int dealerPosition;
int smallBlindPosition;
+1 -1
View File
@@ -24,7 +24,7 @@
using namespace std;
LocalBeRoFlop::LocalBeRoFlop(HandInterface* hi, int id, int qP, int dP, int sB) : LocalBeRo(hi, id, qP, dP, sB, GAME_STATE_FLOP)
LocalBeRoFlop::LocalBeRoFlop(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_FLOP)
{
}
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoFlop : public LocalBeRo{
public:
LocalBeRoFlop(HandInterface*, int, int, int, int);
LocalBeRoFlop(HandInterface*, int, int, int);
~LocalBeRoFlop();
};
@@ -25,7 +25,7 @@
using namespace std;
LocalBeRoPostRiver::LocalBeRoPostRiver(HandInterface* hi, int id, int qP, int dP, int sB) : LocalBeRo(hi, id, qP, dP, sB, GAME_STATE_POST_RIVER), highestCardsValue(0)
LocalBeRoPostRiver::LocalBeRoPostRiver(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_POST_RIVER), highestCardsValue(0)
{
}
@@ -49,7 +49,7 @@ void LocalBeRoPostRiver::postRiverRun() {
}
// Durchschnittsets des human player ermitteln
getMyHand()->getPlayerArray()[0]->setMyAverageSets(((getMyHand()->getPlayerArray()[0]->getMyRoundStartCash())-(getMyHand()->getPlayerArray()[0]->getMyCash()))/(getMyHand()->getBettingRoundsPlayed()+1));
// 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
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoPostRiver : public LocalBeRo{
public:
LocalBeRoPostRiver(HandInterface*, int, int, int, int);
LocalBeRoPostRiver(HandInterface*, int, int, int);
~LocalBeRoPostRiver();
void setHighestCardsValue(int theValue) { highestCardsValue = theValue;}
+1 -1
View File
@@ -24,7 +24,7 @@
using namespace std;
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, int qP, int dP, int sB) : LocalBeRo(hi, id, qP, 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), bigBlindPosition(0)
{
setHighestSet(2*getSmallBlind());
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoPreflop : public LocalBeRo{
public:
LocalBeRoPreflop(HandInterface*, int, int, int, int);
LocalBeRoPreflop(HandInterface*, int, int, int);
~LocalBeRoPreflop();
void run();
+1 -1
View File
@@ -25,7 +25,7 @@
using namespace std;
LocalBeRoRiver::LocalBeRoRiver(HandInterface* hi, int id, int qP, int dP, int sB) : LocalBeRo(hi, id, qP, dP, sB, GAME_STATE_RIVER)
LocalBeRoRiver::LocalBeRoRiver(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_RIVER)
{
}
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoRiver : public LocalBeRo{
public:
LocalBeRoRiver(HandInterface*, int, int, int, int);
LocalBeRoRiver(HandInterface*, int, int, int);
~LocalBeRoRiver();
};
+1 -1
View File
@@ -24,7 +24,7 @@
using namespace std;
LocalBeRoTurn::LocalBeRoTurn(HandInterface* hi, int id, int qP, int dP, int sB) : LocalBeRo(hi, id, qP, dP, sB, GAME_STATE_TURN)
LocalBeRoTurn::LocalBeRoTurn(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_TURN)
{
}
+1 -1
View File
@@ -27,7 +27,7 @@ class HandInterface;
class LocalBeRoTurn : public LocalBeRo{
public:
LocalBeRoTurn(HandInterface*, int, int, int, int);
LocalBeRoTurn(HandInterface*, int, int, int);
~LocalBeRoTurn();
};
@@ -48,19 +48,19 @@ BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
boost::shared_ptr<PlayerInterface> LocalEngineFactory::createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) { return boost::shared_ptr<PlayerInterface> (new LocalPlayer(myConfig, b, id, uniqueId, type, name, avatar, sC, aS, mB)); }
std::vector<boost::shared_ptr<BeRoInterface> > LocalEngineFactory::createBeRo(HandInterface* hi, int id, int aP, int dP, int sB) {
std::vector<boost::shared_ptr<BeRoInterface> > LocalEngineFactory::createBeRo(HandInterface* hi, int id, int dP, int sB) {
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, id, aP, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, id, aP, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, id, aP, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, id, aP, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, id, aP, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, id, dP, sB)));
return myBeRo;
+1 -1
View File
@@ -40,7 +40,7 @@ public:
HandInterface* createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl, PlayerList apl, PlayerList rpl, int id, int sP, int aP, 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, int aP, int dP, int sB);
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, int dP, int sB);
private:
ConfigFile *myConfig;
+64 -83
View File
@@ -27,11 +27,12 @@
using namespace std;
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl, PlayerList apl, PlayerList rpl, int id, int sP, int aP, int dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), playerArray(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), actualQuantityPlayers(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), activePlayersCounter(aP), lastPlayersTurn(0), allInCondition(0),
: myFactory(f), myGui(g), myBoard(b), playerArray(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(0),
cardsShown(false), bettingRoundsPlayed(0)
{
int i, j, k;
PlayerList::iterator it;
CardsValue myCardsValue;
@@ -55,6 +56,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
int tempBoardArray[5];
int tempPlayerArray[2];
int tempPlayerAndBoardArray[7];
int bestHandPos[5];
int sBluff;
for(i=0; i<5; i++) {
tempBoardArray[i] = cardsArray[i];
@@ -63,40 +65,37 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
k = 0;
myBoard->setMyCards(tempBoardArray);
for(i=0; i<startQuantityPlayers; i++) {
if(playerArray[i]->getMyActiveStatus() != 0) {
for(it=activePlayerList.begin(); it!=activePlayerList.end(); it++, k++) {
int bestHandPos[5];
playerArray[i]->getMyBestHandPosition(bestHandPos);
(*it)->getMyBestHandPosition(bestHandPos);
for(j=0; j<2; j++) {
tempPlayerArray[j] = cardsArray[2*k+j+5];
tempPlayerAndBoardArray[j] = cardsArray[2*k+j+5];
for(j=0; j<2; j++) {
tempPlayerArray[j] = cardsArray[2*k+j+5];
tempPlayerAndBoardArray[j] = cardsArray[2*k+j+5];
}
(*it)->setMyCards(tempPlayerArray);
(*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray, bestHandPos));
(*it)->setMyBestHandPosition(bestHandPos);
// myBestHandPosition auf Fehler ueberpruefen
for(j=0; j<5; j++) {
if (bestHandPos[j] == -1) {
cout << "ERROR getMyBestHandPosition in localhand.cpp" << endl;
}
playerArray[i]->setMyCards(tempPlayerArray);
playerArray[i]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray, bestHandPos));
playerArray[i]->setMyBestHandPosition(bestHandPos);
}
// myBestHandPosition auf Fehler ueberpruefen
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
if(i) {
Tools::getRandNumber(1,100,1,&sBluff,0);
playerArray[i]->setSBluff(sBluff);
playerArray[i]->setSBluffStatus(0);
}
k++;
// sBluff für alle aktiver Spieler außer human player setzen
if(it!=activePlayerList.begin()) {
Tools::getRandNumber(1,100,1,&sBluff,0);
(*it)->setSBluff(sBluff);
(*it)->setSBluffStatus(0);
}
}
delete[] cardsArray;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEBUGGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
if(DEBUG_MODE) {
@@ -260,7 +259,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// Dealer, SB, BB bestimmen
assignButtons();
myBeRo = myFactory->createBeRo(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
}
@@ -286,12 +285,7 @@ void LocalHand::start() {
void LocalHand::assignButtons() {
int i,j;
//Aktive Spieler zählen
int activePlayersCounter = 0;
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
if (playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
}
PlayerList::iterator it;
// alle Buttons loeschen
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
@@ -306,7 +300,7 @@ void LocalHand::assignButtons() {
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
if(playerArray[i]->getMyActiveStatus()) {
if(activePlayersCounter > 2) playerArray[i]->setMyButton(2); //small blind normal
if(activePlayerList.size() > 2) playerArray[i]->setMyButton(2); //small blind normal
else playerArray[i]->setMyButton(3); //big blind in heads up
}
}
@@ -316,41 +310,45 @@ void LocalHand::assignButtons() {
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
if(playerArray[i]->getMyActiveStatus()) {
if(activePlayersCounter > 2) playerArray[i]->setMyButton(3); //big blind normal
if(activePlayerList.size() > 2) playerArray[i]->setMyButton(3); //big blind normal
else playerArray[i]->setMyButton(2); //small blind in heads up
}
}
//do sets
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
for (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) {
if(playerArray[i]->getMyButton() == 2) {
//small blind
// mit SmallBlind All In ?
if(playerArray[i]->getMyCash() <= smallBlind) {
if((*it)->getMyButton() == 2) {
playerArray[i]->setMySet(playerArray[i]->getMyCash());
// All in ?
if((*it)->getMyCash() <= smallBlind) {
(*it)->setMySet((*it)->getMyCash());
// 1 to do not log this
playerArray[i]->setMyAction(6,1);
(*it)->setMyAction(6,1);
// delete this player from runningPlayerList
it = runningPlayerList.erase(it);
}
// sonst
else { playerArray[i]->setMySet(smallBlind); }
else { (*it)->setMySet(smallBlind); }
}
if(playerArray[i]->getMyButton() == 3) {
//big blind
// mit BigBlind All In ?
if(playerArray[i]->getMyCash() <= 2*smallBlind) {
if((*it)->getMyButton() == 3) {
playerArray[i]->setMySet(playerArray[i]->getMyCash());
// all in ?
if((*it)->getMyCash() <= 2*smallBlind) {
(*it)->setMySet((*it)->getMyCash());
// 1 to do not log this
playerArray[i]->setMyAction(6,1);
(*it)->setMyAction(6,1);
// delete this player from runningPlayerList
it = runningPlayerList.erase(it);
}
// sonst
else { playerArray[i]->setMySet(2*smallBlind); }
else { (*it)->setMySet(2*smallBlind); }
}
}
@@ -359,25 +357,17 @@ void LocalHand::assignButtons() {
void LocalHand::switchRounds() {
int i;
// cout <<" ------- HandID: " << myID << " | actualround: " << actualRound << " ---------" << endl;
//Aktive Spieler zlen
activePlayersCounter = 0;
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
if (playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
}
PlayerList::iterator it;
// Anzahl der Spieler ermitteln, welche All In sind
int allInPlayersCounter = 0;
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
if (playerArray[i]->getMyAction() == 6) allInPlayersCounter++;
for (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) {
if ((*it)->getMyAction() == 6) allInPlayersCounter++;
}
//wenn nur noch einer nicht-folded dann gleich den Pot verteilen
if(activePlayersCounter==1) {
if(activePlayerList.size()==1) {
myBoard->collectPot();
myGui->refreshPot();
myGui->refreshSet();
@@ -387,31 +377,22 @@ void LocalHand::switchRounds() {
// fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein
else {
// cout << "activplayerscounter: " << activePlayersCounter << " | allInPlayersCounter: " << allInPlayersCounter << " | " << endl;
// 1) wenn alle All In
if(allInPlayersCounter == activePlayersCounter) {
allInCondition = 1;
if(allInPlayersCounter == activePlayerList.size()) {
allInCondition = true;
}
// 2) alle bis auf einen All In und der hat HighestSet
int tempHighestSet;
if(allInPlayersCounter+1 == activePlayersCounter) {
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
// Spieler ermitteln, der noch nicht All In ist
if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1) {
tempHighestSet = 0;
tempHighestSet = myBeRo[actualRound]->getHighestSet();
// cout << "tempHighestSet: " << tempHighestSet << "playerArray[i]->getMySet(): " << playerArray[i]->getMySet() << endl;
if(playerArray[i]->getMySet() >= tempHighestSet) {
allInCondition = 1;
}
if(allInPlayersCounter+1 == activePlayerList.size()) {
}
if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[actualRound]->getHighestSet() ) {
allInCondition = 1;
}
// HeadsUp-Ausnahme -> spieler ermitteln, der all in ist und als bb nur weniger als sb setzen konnte
if(activePlayersCounter==2 && playerArray[i]->getMyAction() == 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMyButton()==3 && playerArray[i]->getMySet()<=smallBlind) {
// 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;
}
@@ -439,7 +420,7 @@ void LocalHand::switchRounds() {
}
//unhighlight actual players groupbox
//unhighlight current players groupbox
if(playerArray[lastPlayersTurn]->getMyActiveStatus() == 1) myGui->refreshGroupbox(lastPlayersTurn,1);
myGui->refreshGameLabels((GameState)getActualRound());
+3 -8
View File
@@ -40,6 +40,9 @@ public:
void start();
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const { return playerArray; }
PlayerList getActivePlayerList() const {return activePlayerList;}
PlayerList getRunningPlayerList() const {return runningPlayerList;}
BoardInterface* getBoard() const { return myBoard; }
boost::shared_ptr<BeRoInterface> getPreflop() const { return myBeRo[GAME_STATE_PREFLOP]; }
boost::shared_ptr<BeRoInterface> getFlop() const { return myBeRo[GAME_STATE_FLOP]; }
@@ -50,9 +53,6 @@ public:
void setMyID(int theValue) { myID = theValue; }
int getMyID() const { return myID; }
void setActualQuantityPlayers(int theValue) { actualQuantityPlayers = theValue; }
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
int getStartQuantityPlayers() const { return startQuantityPlayers; }
@@ -71,9 +71,6 @@ public:
void setStartCash(int theValue) { startCash = theValue; }
int getStartCash() const { return startCash; }
void setActivePlayersCounter(int theValue) { activePlayersCounter = theValue; }
int getActivePlayersCounter() const { return activePlayersCounter; }
void setBettingRoundsPlayed(int theValue) { bettingRoundsPlayed = theValue; }
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
@@ -102,13 +99,11 @@ private:
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
int myID;
int actualQuantityPlayers;
int startQuantityPlayers;
int dealerPosition; // -1 -> neutral
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
int smallBlind;
int startCash;
int activePlayersCounter;
int lastPlayersTurn;
+17 -17
View File
@@ -987,7 +987,7 @@ void LocalPlayer::preflopEngine() {
int cBluff;
// temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler
int players = actualHand->getActualQuantityPlayers();
int players = actualHand->getActivePlayerList().size();
if(players > 5) players = 5;
// myOdds auslesen
@@ -1018,7 +1018,7 @@ 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)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0);
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList().size())*21.0);
// cout << aggValue << " ";
@@ -1122,7 +1122,7 @@ void LocalPlayer::preflopEngine() {
// cout << sBluff << endl;
// auf sBluff testen --> raise statt call oder fold
if((sBluff < 100/(((actualHand->getActualQuantityPlayers()-2)*6)+3) && myOdds < myNiveau[2] && actualHand->getCurrentBeRo()->getHighestSet() == 2*actualHand->getSmallBlind() && sBluffStatus == 0) || sBluffStatus == 1) {
if((sBluff < 100/(((actualHand->getActivePlayerList().size()-2)*6)+3) && myOdds < myNiveau[2] && actualHand->getCurrentBeRo()->getHighestSet() == 2*actualHand->getSmallBlind() && sBluffStatus == 0) || sBluffStatus == 1) {
// cout << "sBLUFF!" << endl;
sBluffStatus = 1;
@@ -1143,7 +1143,7 @@ void LocalPlayer::preflopEngine() {
// Standard-Raise-Routine
else {
// raise-Betrag ermitteln
raise = (sBluff/(8-actualHand->getActualQuantityPlayers()))*actualHand->getSmallBlind();
raise = (sBluff/(8-actualHand->getActivePlayerList().size()))*actualHand->getSmallBlind();
// raise-Betrag zu klein -> mindestens Standard-raise
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
// raise = actualHand->getCurrentBeRo()->getHighestSet();
@@ -1255,7 +1255,7 @@ void LocalPlayer::flopEngine() {
int rand;
// übergang solange preflopValue und flopValue noch nicht bereinigt
int players = actualHand->getActualQuantityPlayers();
int players = actualHand->getActivePlayerList().size();
if(players > 5) players = 5;
calcMyOdds();
@@ -1273,7 +1273,7 @@ void LocalPlayer::flopEngine() {
if(individualHighestSet > myCash) individualHighestSet = myCash;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0);
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList().size())*21.0);
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
for(i=0; i<3; i++) {
@@ -1716,7 +1716,7 @@ void LocalPlayer::flopEngine() {
// switch(info[3]) {
// case 2: {}
// case 1: {
// if(actualHand->getActualQuantityPlayers() == 2) {
// if(actualHand->getActivePlayerList().size() == 2) {
// bet = (1-myDude4)*2*actualHand->getSmallBlind();
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
@@ -1836,14 +1836,14 @@ void LocalPlayer::turnEngine() {
// Niveaus setzen + Dude + Anzahl Gegenspieler
// 1. Fold -- Call
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// 2. Check -- Bet
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// 3. Call -- Raise
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0);
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList().size())*21.0);
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
for(i=0; i<3; i++) {
@@ -2172,14 +2172,14 @@ void LocalPlayer::riverEngine() {
// Niveaus setzen + Dude + Anzahl Gegenspieler
// 1. Fold -- Call
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// 2. Check -- Bet
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// 3. Call -- Raise
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0);
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList().size())*21.0);
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
for(i=0; i<3; i++) {
@@ -3226,7 +3226,7 @@ void LocalPlayer::calcMyOdds() {
handCode = preflopCardsValue(myCards);
// übergang solange preflopValue und flopValue noch nicht bereinigt
int players = actualHand->getActualQuantityPlayers();
int players = actualHand->getActivePlayerList().size();
if(players > 5) players = 5;
// paranoia
if(players < 2) players = 2;
@@ -3259,7 +3259,7 @@ void LocalPlayer::calcMyOdds() {
// cout << "\t" << handCode << endl;
// übergang solange preflopValue und flopValue noch nicht bereinigt
int players = actualHand->getActualQuantityPlayers();
int players = actualHand->getActivePlayerList().size();
if(players > 5) players = 5;
// paranoia
if(players < 2) players = 2;