adds activePlayerList and runningPlayerList (II)
This commit is contained in:
@@ -36,7 +36,7 @@ public:
|
|||||||
virtual 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) =0;
|
virtual 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) =0;
|
||||||
virtual BoardInterface* createBoard() =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 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, int aP, int dP, int sB) =0;
|
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, int dP, int sB) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public:
|
|||||||
virtual void start() = 0;
|
virtual void start() = 0;
|
||||||
|
|
||||||
virtual std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const =0;
|
virtual std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const =0;
|
||||||
|
virtual PlayerList getActivePlayerList() const =0;
|
||||||
|
virtual PlayerList getRunningPlayerList() const =0;
|
||||||
|
|
||||||
virtual BoardInterface* getBoard() const =0;
|
virtual BoardInterface* getBoard() const =0;
|
||||||
virtual boost::shared_ptr<BeRoInterface> getPreflop() const =0;
|
virtual boost::shared_ptr<BeRoInterface> getPreflop() const =0;
|
||||||
virtual boost::shared_ptr<BeRoInterface> getFlop() const =0;
|
virtual boost::shared_ptr<BeRoInterface> getFlop() const =0;
|
||||||
@@ -48,9 +51,6 @@ public:
|
|||||||
virtual void setMyID(int theValue) =0;
|
virtual void setMyID(int theValue) =0;
|
||||||
virtual int getMyID() const =0;
|
virtual int getMyID() const =0;
|
||||||
|
|
||||||
virtual void setActualQuantityPlayers(int theValue) =0;
|
|
||||||
virtual int getActualQuantityPlayers() const =0;
|
|
||||||
|
|
||||||
virtual void setStartQuantityPlayers(int theValue) =0;
|
virtual void setStartQuantityPlayers(int theValue) =0;
|
||||||
virtual int getStartQuantityPlayers() const =0;
|
virtual int getStartQuantityPlayers() const =0;
|
||||||
|
|
||||||
@@ -69,9 +69,6 @@ public:
|
|||||||
virtual void setStartCash(int theValue) =0;
|
virtual void setStartCash(int theValue) =0;
|
||||||
virtual int getStartCash() const =0;
|
virtual int getStartCash() const =0;
|
||||||
|
|
||||||
virtual void setActivePlayersCounter(int theValue) =0;
|
|
||||||
virtual int getActivePlayersCounter() const =0;
|
|
||||||
|
|
||||||
virtual void setBettingRoundsPlayed(int theValue) =0;
|
virtual void setBettingRoundsPlayed(int theValue) =0;
|
||||||
virtual int getBettingRoundsPlayed() const =0;
|
virtual int getBettingRoundsPlayed() const =0;
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
LocalBeRo::LocalBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS)
|
LocalBeRo::LocalBeRo(HandInterface* hi, int id, 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)
|
: 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;
|
int i;
|
||||||
@@ -145,8 +145,8 @@ void LocalBeRo::run() {
|
|||||||
|
|
||||||
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
|
// wenn wir letzter aktiver Spieler vor SmallBlind sind, dann flopFirstRound zuende
|
||||||
// ausnahme bei heads up !!! --> TODO
|
// ausnahme bei heads up !!! --> TODO
|
||||||
if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind && myHand->getActualQuantityPlayers() >= 3) { firstRound = 0; }
|
if(myHand->getPlayerArray()[playersTurn]->getMyID() == activePlayerBeforeSmallBlind && myHand->getActivePlayerList().size() >= 3) { firstRound = 0; }
|
||||||
if(myHand->getActualQuantityPlayers() < 3 && (myHand->getPlayerArray()[playersTurn]->getMyID() == dealerPosition || myHand->getPlayerArray()[playersTurn]->getMyID() == smallBlindPosition)) { firstRound = 0; }
|
if(myHand->getActivePlayerList().size() < 3 && (myHand->getPlayerArray()[playersTurn]->getMyID() == dealerPosition || myHand->getPlayerArray()[playersTurn]->getMyID() == smallBlindPosition)) { firstRound = 0; }
|
||||||
|
|
||||||
if(playersTurn == 0) {
|
if(playersTurn == 0) {
|
||||||
// Wir sind dran
|
// Wir sind dran
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
class LocalBeRo : public BeRoInterface{
|
class LocalBeRo : public BeRoInterface{
|
||||||
public:
|
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();
|
~LocalBeRo();
|
||||||
|
|
||||||
GameState getMyBeRoID() const { return myBeRoID; }
|
GameState getMyBeRoID() const { return myBeRoID; }
|
||||||
@@ -77,7 +77,6 @@ private:
|
|||||||
|
|
||||||
const GameState myBeRoID;
|
const GameState myBeRoID;
|
||||||
int myID;
|
int myID;
|
||||||
int actualQuantityPlayers;
|
|
||||||
int dealerPosition;
|
int dealerPosition;
|
||||||
int smallBlindPosition;
|
int smallBlindPosition;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class HandInterface;
|
|||||||
class LocalBeRoFlop : public LocalBeRo{
|
class LocalBeRoFlop : public LocalBeRo{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LocalBeRoFlop(HandInterface*, int, int, int, int);
|
LocalBeRoFlop(HandInterface*, int, int, int);
|
||||||
~LocalBeRoFlop();
|
~LocalBeRoFlop();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
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
|
// 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
|
// Aggressivität des human player ermitteln
|
||||||
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class HandInterface;
|
|||||||
|
|
||||||
class LocalBeRoPostRiver : public LocalBeRo{
|
class LocalBeRoPostRiver : public LocalBeRo{
|
||||||
public:
|
public:
|
||||||
LocalBeRoPostRiver(HandInterface*, int, int, int, int);
|
LocalBeRoPostRiver(HandInterface*, int, int, int);
|
||||||
~LocalBeRoPostRiver();
|
~LocalBeRoPostRiver();
|
||||||
|
|
||||||
void setHighestCardsValue(int theValue) { highestCardsValue = theValue;}
|
void setHighestCardsValue(int theValue) { highestCardsValue = theValue;}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
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());
|
setHighestSet(2*getSmallBlind());
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class HandInterface;
|
|||||||
class LocalBeRoPreflop : public LocalBeRo{
|
class LocalBeRoPreflop : public LocalBeRo{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LocalBeRoPreflop(HandInterface*, int, int, int, int);
|
LocalBeRoPreflop(HandInterface*, int, int, int);
|
||||||
~LocalBeRoPreflop();
|
~LocalBeRoPreflop();
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class HandInterface;
|
|||||||
|
|
||||||
class LocalBeRoRiver : public LocalBeRo{
|
class LocalBeRoRiver : public LocalBeRo{
|
||||||
public:
|
public:
|
||||||
LocalBeRoRiver(HandInterface*, int, int, int, int);
|
LocalBeRoRiver(HandInterface*, int, int, int);
|
||||||
~LocalBeRoRiver();
|
~LocalBeRoRiver();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
using namespace std;
|
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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class HandInterface;
|
|||||||
|
|
||||||
class LocalBeRoTurn : public LocalBeRo{
|
class LocalBeRoTurn : public LocalBeRo{
|
||||||
public:
|
public:
|
||||||
LocalBeRoTurn(HandInterface*, int, int, int, int);
|
LocalBeRoTurn(HandInterface*, int, int, int);
|
||||||
~LocalBeRoTurn();
|
~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)); }
|
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;
|
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;
|
return myBeRo;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
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();
|
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);
|
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:
|
private:
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
|
|||||||
@@ -27,11 +27,12 @@
|
|||||||
using namespace std;
|
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)
|
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)
|
cardsShown(false), bettingRoundsPlayed(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
PlayerList::iterator it;
|
||||||
|
|
||||||
CardsValue myCardsValue;
|
CardsValue myCardsValue;
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
int tempBoardArray[5];
|
int tempBoardArray[5];
|
||||||
int tempPlayerArray[2];
|
int tempPlayerArray[2];
|
||||||
int tempPlayerAndBoardArray[7];
|
int tempPlayerAndBoardArray[7];
|
||||||
|
int bestHandPos[5];
|
||||||
int sBluff;
|
int sBluff;
|
||||||
for(i=0; i<5; i++) {
|
for(i=0; i<5; i++) {
|
||||||
tempBoardArray[i] = cardsArray[i];
|
tempBoardArray[i] = cardsArray[i];
|
||||||
@@ -63,40 +65,37 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
|
|
||||||
k = 0;
|
k = 0;
|
||||||
myBoard->setMyCards(tempBoardArray);
|
myBoard->setMyCards(tempBoardArray);
|
||||||
for(i=0; i<startQuantityPlayers; i++) {
|
for(it=activePlayerList.begin(); it!=activePlayerList.end(); it++, k++) {
|
||||||
if(playerArray[i]->getMyActiveStatus() != 0) {
|
|
||||||
|
|
||||||
int bestHandPos[5];
|
(*it)->getMyBestHandPosition(bestHandPos);
|
||||||
playerArray[i]->getMyBestHandPosition(bestHandPos);
|
|
||||||
|
|
||||||
for(j=0; j<2; j++) {
|
for(j=0; j<2; j++) {
|
||||||
tempPlayerArray[j] = cardsArray[2*k+j+5];
|
tempPlayerArray[j] = cardsArray[2*k+j+5];
|
||||||
tempPlayerAndBoardArray[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
|
// sBluff für alle aktiver Spieler außer human player setzen
|
||||||
for(j=0; j<5; j++) {
|
if(it!=activePlayerList.begin()) {
|
||||||
if (bestHandPos[j] == -1) {
|
Tools::getRandNumber(1,100,1,&sBluff,0);
|
||||||
cout << "ERROR getMyBestHandPosition in localhand.cpp" << endl;
|
(*it)->setSBluff(sBluff);
|
||||||
}
|
(*it)->setSBluffStatus(0);
|
||||||
}
|
|
||||||
|
|
||||||
// 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++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] cardsArray;
|
delete[] cardsArray;
|
||||||
|
|
||||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEBUGGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
|
||||||
|
|
||||||
if(DEBUG_MODE) {
|
if(DEBUG_MODE) {
|
||||||
|
|
||||||
@@ -260,7 +259,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
|||||||
// Dealer, SB, BB bestimmen
|
// Dealer, SB, BB bestimmen
|
||||||
assignButtons();
|
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() {
|
void LocalHand::assignButtons() {
|
||||||
|
|
||||||
int i,j;
|
int i,j;
|
||||||
|
PlayerList::iterator it;
|
||||||
//Aktive Spieler zählen
|
|
||||||
int activePlayersCounter = 0;
|
|
||||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
|
||||||
if (playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// alle Buttons loeschen
|
// alle Buttons loeschen
|
||||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
|
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);
|
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
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
|
else playerArray[i]->setMyButton(3); //big blind in heads up
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -316,41 +310,45 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
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
|
else playerArray[i]->setMyButton(2); //small blind in heads up
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//do sets
|
//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
|
//small blind
|
||||||
// mit SmallBlind All In ?
|
if((*it)->getMyButton() == 2) {
|
||||||
if(playerArray[i]->getMyCash() <= smallBlind) {
|
|
||||||
|
|
||||||
playerArray[i]->setMySet(playerArray[i]->getMyCash());
|
// All in ?
|
||||||
|
if((*it)->getMyCash() <= smallBlind) {
|
||||||
|
|
||||||
|
(*it)->setMySet((*it)->getMyCash());
|
||||||
// 1 to do not log this
|
// 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 { (*it)->setMySet(smallBlind); }
|
||||||
else { playerArray[i]->setMySet(smallBlind); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(playerArray[i]->getMyButton() == 3) {
|
|
||||||
//big blind
|
//big blind
|
||||||
// mit BigBlind All In ?
|
if((*it)->getMyButton() == 3) {
|
||||||
if(playerArray[i]->getMyCash() <= 2*smallBlind) {
|
|
||||||
|
|
||||||
playerArray[i]->setMySet(playerArray[i]->getMyCash());
|
// all in ?
|
||||||
|
if((*it)->getMyCash() <= 2*smallBlind) {
|
||||||
|
|
||||||
|
(*it)->setMySet((*it)->getMyCash());
|
||||||
// 1 to do not log this
|
// 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 { (*it)->setMySet(2*smallBlind); }
|
||||||
else { playerArray[i]->setMySet(2*smallBlind); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -359,25 +357,17 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
void LocalHand::switchRounds() {
|
void LocalHand::switchRounds() {
|
||||||
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
PlayerList::iterator it;
|
||||||
// cout <<" ------- HandID: " << myID << " | actualround: " << actualRound << " ---------" << endl;
|
|
||||||
|
|
||||||
//Aktive Spieler z�len
|
|
||||||
activePlayersCounter = 0;
|
|
||||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
|
||||||
if (playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Anzahl der Spieler ermitteln, welche All In sind
|
// Anzahl der Spieler ermitteln, welche All In sind
|
||||||
int allInPlayersCounter = 0;
|
int allInPlayersCounter = 0;
|
||||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
for (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) {
|
||||||
if (playerArray[i]->getMyAction() == 6) allInPlayersCounter++;
|
if ((*it)->getMyAction() == 6) allInPlayersCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//wenn nur noch einer nicht-folded dann gleich den Pot verteilen
|
//wenn nur noch einer nicht-folded dann gleich den Pot verteilen
|
||||||
if(activePlayersCounter==1) {
|
if(activePlayerList.size()==1) {
|
||||||
myBoard->collectPot();
|
myBoard->collectPot();
|
||||||
myGui->refreshPot();
|
myGui->refreshPot();
|
||||||
myGui->refreshSet();
|
myGui->refreshSet();
|
||||||
@@ -387,31 +377,22 @@ void LocalHand::switchRounds() {
|
|||||||
// fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein
|
// fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// cout << "activplayerscounter: " << activePlayersCounter << " | allInPlayersCounter: " << allInPlayersCounter << " | " << endl;
|
|
||||||
|
|
||||||
// 1) wenn alle All In
|
// 1) wenn alle All In
|
||||||
if(allInPlayersCounter == activePlayersCounter) {
|
if(allInPlayersCounter == activePlayerList.size()) {
|
||||||
allInCondition = 1;
|
allInCondition = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2) alle bis auf einen All In und der hat HighestSet
|
// 2) alle bis auf einen All In und der hat HighestSet
|
||||||
int tempHighestSet;
|
if(allInPlayersCounter+1 == activePlayerList.size()) {
|
||||||
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( (*(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
|
// 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) {
|
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;
|
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);
|
if(playerArray[lastPlayersTurn]->getMyActiveStatus() == 1) myGui->refreshGroupbox(lastPlayersTurn,1);
|
||||||
|
|
||||||
myGui->refreshGameLabels((GameState)getActualRound());
|
myGui->refreshGameLabels((GameState)getActualRound());
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ public:
|
|||||||
void start();
|
void start();
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const { return playerArray; }
|
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; }
|
BoardInterface* getBoard() const { return myBoard; }
|
||||||
boost::shared_ptr<BeRoInterface> getPreflop() const { return myBeRo[GAME_STATE_PREFLOP]; }
|
boost::shared_ptr<BeRoInterface> getPreflop() const { return myBeRo[GAME_STATE_PREFLOP]; }
|
||||||
boost::shared_ptr<BeRoInterface> getFlop() const { return myBeRo[GAME_STATE_FLOP]; }
|
boost::shared_ptr<BeRoInterface> getFlop() const { return myBeRo[GAME_STATE_FLOP]; }
|
||||||
@@ -50,9 +53,6 @@ public:
|
|||||||
|
|
||||||
void setMyID(int theValue) { myID = theValue; }
|
void setMyID(int theValue) { myID = theValue; }
|
||||||
int getMyID() const { return myID; }
|
int getMyID() const { return myID; }
|
||||||
|
|
||||||
void setActualQuantityPlayers(int theValue) { actualQuantityPlayers = theValue; }
|
|
||||||
int getActualQuantityPlayers() const { return actualQuantityPlayers; }
|
|
||||||
|
|
||||||
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
||||||
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
int getStartQuantityPlayers() const { return startQuantityPlayers; }
|
||||||
@@ -71,9 +71,6 @@ public:
|
|||||||
|
|
||||||
void setStartCash(int theValue) { startCash = theValue; }
|
void setStartCash(int theValue) { startCash = theValue; }
|
||||||
int getStartCash() const { return startCash; }
|
int getStartCash() const { return startCash; }
|
||||||
|
|
||||||
void setActivePlayersCounter(int theValue) { activePlayersCounter = theValue; }
|
|
||||||
int getActivePlayersCounter() const { return activePlayersCounter; }
|
|
||||||
|
|
||||||
void setBettingRoundsPlayed(int theValue) { bettingRoundsPlayed = theValue; }
|
void setBettingRoundsPlayed(int theValue) { bettingRoundsPlayed = theValue; }
|
||||||
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
|
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
|
||||||
@@ -102,13 +99,11 @@ private:
|
|||||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||||
|
|
||||||
int myID;
|
int myID;
|
||||||
int actualQuantityPlayers;
|
|
||||||
int startQuantityPlayers;
|
int startQuantityPlayers;
|
||||||
int dealerPosition; // -1 -> neutral
|
int dealerPosition; // -1 -> neutral
|
||||||
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
||||||
int smallBlind;
|
int smallBlind;
|
||||||
int startCash;
|
int startCash;
|
||||||
int activePlayersCounter;
|
|
||||||
|
|
||||||
int lastPlayersTurn;
|
int lastPlayersTurn;
|
||||||
|
|
||||||
|
|||||||
@@ -987,7 +987,7 @@ void LocalPlayer::preflopEngine() {
|
|||||||
int cBluff;
|
int cBluff;
|
||||||
|
|
||||||
// temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler
|
// 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;
|
if(players > 5) players = 5;
|
||||||
|
|
||||||
// myOdds auslesen
|
// myOdds auslesen
|
||||||
@@ -1018,7 +1018,7 @@ void LocalPlayer::preflopEngine() {
|
|||||||
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
|
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
|
||||||
|
|
||||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
// 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 << " ";
|
// cout << aggValue << " ";
|
||||||
|
|
||||||
@@ -1122,7 +1122,7 @@ void LocalPlayer::preflopEngine() {
|
|||||||
// cout << sBluff << endl;
|
// cout << sBluff << endl;
|
||||||
|
|
||||||
// auf sBluff testen --> raise statt call oder fold
|
// 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;
|
// cout << "sBLUFF!" << endl;
|
||||||
sBluffStatus = 1;
|
sBluffStatus = 1;
|
||||||
@@ -1143,7 +1143,7 @@ void LocalPlayer::preflopEngine() {
|
|||||||
// Standard-Raise-Routine
|
// Standard-Raise-Routine
|
||||||
else {
|
else {
|
||||||
// raise-Betrag ermitteln
|
// 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
|
// raise-Betrag zu klein -> mindestens Standard-raise
|
||||||
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
|
// if(raise < actualHand->getCurrentBeRo()->getHighestSet()) {
|
||||||
// raise = actualHand->getCurrentBeRo()->getHighestSet();
|
// raise = actualHand->getCurrentBeRo()->getHighestSet();
|
||||||
@@ -1255,7 +1255,7 @@ void LocalPlayer::flopEngine() {
|
|||||||
int rand;
|
int rand;
|
||||||
|
|
||||||
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
||||||
int players = actualHand->getActualQuantityPlayers();
|
int players = actualHand->getActivePlayerList().size();
|
||||||
if(players > 5) players = 5;
|
if(players > 5) players = 5;
|
||||||
|
|
||||||
calcMyOdds();
|
calcMyOdds();
|
||||||
@@ -1273,7 +1273,7 @@ void LocalPlayer::flopEngine() {
|
|||||||
if(individualHighestSet > myCash) individualHighestSet = myCash;
|
if(individualHighestSet > myCash) individualHighestSet = myCash;
|
||||||
|
|
||||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
// 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) {
|
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
for(i=0; i<3; i++) {
|
for(i=0; i<3; i++) {
|
||||||
@@ -1716,7 +1716,7 @@ void LocalPlayer::flopEngine() {
|
|||||||
// switch(info[3]) {
|
// switch(info[3]) {
|
||||||
// case 2: {}
|
// case 2: {}
|
||||||
// case 1: {
|
// case 1: {
|
||||||
// if(actualHand->getActualQuantityPlayers() == 2) {
|
// if(actualHand->getActivePlayerList().size() == 2) {
|
||||||
// bet = (1-myDude4)*2*actualHand->getSmallBlind();
|
// bet = (1-myDude4)*2*actualHand->getSmallBlind();
|
||||||
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
|
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
|
||||||
// myAction = 4;
|
// myAction = 4;
|
||||||
@@ -1836,14 +1836,14 @@ void LocalPlayer::turnEngine() {
|
|||||||
|
|
||||||
// Niveaus setzen + Dude + Anzahl Gegenspieler
|
// Niveaus setzen + Dude + Anzahl Gegenspieler
|
||||||
// 1. Fold -- Call
|
// 1. Fold -- Call
|
||||||
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
|
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
||||||
// 2. Check -- Bet
|
// 2. Check -- Bet
|
||||||
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
|
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
||||||
// 3. Call -- Raise
|
// 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
|
// 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) {
|
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
for(i=0; i<3; i++) {
|
for(i=0; i<3; i++) {
|
||||||
@@ -2172,14 +2172,14 @@ void LocalPlayer::riverEngine() {
|
|||||||
|
|
||||||
// Niveaus setzen + Dude + Anzahl Gegenspieler
|
// Niveaus setzen + Dude + Anzahl Gegenspieler
|
||||||
// 1. Fold -- Call
|
// 1. Fold -- Call
|
||||||
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
|
myNiveau[0] = 53 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
||||||
// 2. Check -- Bet
|
// 2. Check -- Bet
|
||||||
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/;
|
myNiveau[1] = 56 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
||||||
// 3. Call -- Raise
|
// 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
|
// 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) {
|
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
for(i=0; i<3; i++) {
|
for(i=0; i<3; i++) {
|
||||||
@@ -3226,7 +3226,7 @@ void LocalPlayer::calcMyOdds() {
|
|||||||
handCode = preflopCardsValue(myCards);
|
handCode = preflopCardsValue(myCards);
|
||||||
|
|
||||||
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
||||||
int players = actualHand->getActualQuantityPlayers();
|
int players = actualHand->getActivePlayerList().size();
|
||||||
if(players > 5) players = 5;
|
if(players > 5) players = 5;
|
||||||
// paranoia
|
// paranoia
|
||||||
if(players < 2) players = 2;
|
if(players < 2) players = 2;
|
||||||
@@ -3259,7 +3259,7 @@ void LocalPlayer::calcMyOdds() {
|
|||||||
// cout << "\t" << handCode << endl;
|
// cout << "\t" << handCode << endl;
|
||||||
|
|
||||||
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
||||||
int players = actualHand->getActualQuantityPlayers();
|
int players = actualHand->getActivePlayerList().size();
|
||||||
if(players > 5) players = 5;
|
if(players > 5) players = 5;
|
||||||
// paranoia
|
// paranoia
|
||||||
if(players < 2) players = 2;
|
if(players < 2) players = 2;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
//
|
//
|
||||||
#include "clientbero.h"
|
#include "clientbero.h"
|
||||||
|
|
||||||
ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, int /*qP*/, int dP, int sB, GameState gS)
|
ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, int dP, int sB, GameState gS)
|
||||||
: BeRoInterface(), myBeRoID(gS), myHand(hi), highestCardsValue(0), playersTurn(dP), highestSet(0), firstRound(true), smallBlindPosition(0), smallBlind(sB), minimumRaise(0)
|
: BeRoInterface(), myBeRoID(gS), myHand(hi), highestCardsValue(0), playersTurn(dP), highestSet(0), firstRound(true), smallBlindPosition(0), smallBlind(sB), minimumRaise(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class HandInterface;
|
|||||||
*/
|
*/
|
||||||
class ClientBeRo : public BeRoInterface{
|
class ClientBeRo : public BeRoInterface{
|
||||||
public:
|
public:
|
||||||
ClientBeRo(HandInterface* hi, int id, int qP, int dP, int sB, GameState gS);
|
ClientBeRo(HandInterface* hi, int id, int dP, int sB, GameState gS);
|
||||||
~ClientBeRo();
|
~ClientBeRo();
|
||||||
|
|
||||||
GameState getMyBeRoID() const;
|
GameState getMyBeRoID() const;
|
||||||
|
|||||||
@@ -50,15 +50,15 @@ boost::shared_ptr<PlayerInterface> ClientEngineFactory::createPlayer(BoardInter
|
|||||||
return boost::shared_ptr<PlayerInterface> (new ClientPlayer(NULL, b, id, uniqueId, type, name, avatar, sC, aS, mB));
|
return boost::shared_ptr<PlayerInterface> (new ClientPlayer(NULL, b, id, uniqueId, type, name, avatar, sC, aS, mB));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> > ClientEngineFactory::createBeRo(HandInterface* hi, int id, int aP, int dP, int sB) {
|
std::vector<boost::shared_ptr<BeRoInterface> > ClientEngineFactory::createBeRo(HandInterface* hi, int id, int dP, int sB) {
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||||
|
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_PREFLOP)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, dP, sB, GAME_STATE_PREFLOP)));
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_FLOP)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, dP, sB, GAME_STATE_FLOP)));
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_TURN)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, dP, sB, GAME_STATE_TURN)));
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_RIVER)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, dP, sB, GAME_STATE_RIVER)));
|
||||||
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, aP, dP, sB, GAME_STATE_POST_RIVER)));
|
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, id, dP, sB, GAME_STATE_POST_RIVER)));
|
||||||
|
|
||||||
return myBeRo;
|
return myBeRo;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
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();
|
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);
|
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);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
ClientHand::ClientHand(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)
|
ClientHand::ClientHand(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), myID(id), actualQuantityPlayers(aP), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0),
|
: myFactory(f), myGui(g), myBoard(b), playerArray(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0),
|
||||||
smallBlind(sB), startCash(sC), activePlayersCounter(aP), lastPlayersTurn(0), allInCondition(0),
|
smallBlind(sB), startCash(sC), activePlayersCounter(aP), lastPlayersTurn(0), allInCondition(0),
|
||||||
cardsShown(false), bettingRoundsPlayed(0)
|
cardsShown(false), bettingRoundsPlayed(0)
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, Boar
|
|||||||
// the rest of the buttons are assigned later as received from the server.
|
// the rest of the buttons are assigned later as received from the server.
|
||||||
|
|
||||||
// Preflop, Flop, Turn und River erstellen
|
// Preflop, Flop, Turn und River erstellen
|
||||||
myBeRo = myFactory->createBeRo(this, myID, actualQuantityPlayers, dealerPosition, smallBlind);
|
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -131,20 +131,6 @@ ClientHand::getMyID() const
|
|||||||
return myID;
|
return myID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ClientHand::setActualQuantityPlayers(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
actualQuantityPlayers = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientHand::getActualQuantityPlayers() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return actualQuantityPlayers;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientHand::setStartQuantityPlayers(int theValue)
|
ClientHand::setStartQuantityPlayers(int theValue)
|
||||||
{
|
{
|
||||||
@@ -229,20 +215,6 @@ ClientHand::getStartCash() const
|
|||||||
return startCash;
|
return startCash;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ClientHand::setActivePlayersCounter(int theValue)
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
activePlayersCounter = theValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ClientHand::getActivePlayersCounter() const
|
|
||||||
{
|
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
|
||||||
return activePlayersCounter;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ClientHand::setBettingRoundsPlayed(int theValue)
|
ClientHand::setBettingRoundsPlayed(int theValue)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ class ClientHand : public HandInterface
|
|||||||
void start();
|
void start();
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const;
|
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const;
|
||||||
|
PlayerList getActivePlayerList() const {return activePlayerList;}
|
||||||
|
PlayerList getRunningPlayerList() const {return runningPlayerList;}
|
||||||
|
|
||||||
BoardInterface* getBoard() const;
|
BoardInterface* getBoard() const;
|
||||||
boost::shared_ptr<BeRoInterface> getPreflop() const;
|
boost::shared_ptr<BeRoInterface> getPreflop() const;
|
||||||
boost::shared_ptr<BeRoInterface> getFlop() const;
|
boost::shared_ptr<BeRoInterface> getFlop() const;
|
||||||
@@ -70,9 +73,6 @@ class ClientHand : public HandInterface
|
|||||||
void setStartCash ( int theValue );
|
void setStartCash ( int theValue );
|
||||||
int getStartCash() const;
|
int getStartCash() const;
|
||||||
|
|
||||||
void setActivePlayersCounter ( int theValue );
|
|
||||||
int getActivePlayersCounter() const;
|
|
||||||
|
|
||||||
void setBettingRoundsPlayed ( int theValue );
|
void setBettingRoundsPlayed ( int theValue );
|
||||||
int getBettingRoundsPlayed() const;
|
int getBettingRoundsPlayed() const;
|
||||||
|
|
||||||
@@ -99,7 +99,6 @@ class ClientHand : public HandInterface
|
|||||||
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
|
||||||
|
|
||||||
int myID;
|
int myID;
|
||||||
int actualQuantityPlayers;
|
|
||||||
int startQuantityPlayers;
|
int startQuantityPlayers;
|
||||||
int dealerPosition; // -1 -> neutral
|
int dealerPosition; // -1 -> neutral
|
||||||
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
|
||||||
|
|||||||
+5
-5
@@ -52,9 +52,9 @@ public:
|
|||||||
HandInterface *getCurrentHand();
|
HandInterface *getCurrentHand();
|
||||||
const HandInterface *getCurrentHand() const;
|
const HandInterface *getCurrentHand() const;
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() {return playerArray;}
|
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const {return playerArray;}
|
||||||
std::list<boost::shared_ptr<PlayerInterface> > getActivePlayerList() {return activePlayerList;}
|
PlayerList getActivePlayerList() const {return activePlayerList;}
|
||||||
std::list<boost::shared_ptr<PlayerInterface> > getRunningPlayerList() {return runningPlayerList;}
|
PlayerList getRunningPlayerList() const {return runningPlayerList;}
|
||||||
|
|
||||||
//Zufgriff Startvariablen
|
//Zufgriff Startvariablen
|
||||||
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
|
||||||
@@ -89,8 +89,8 @@ private:
|
|||||||
BoardInterface *actualBoard;
|
BoardInterface *actualBoard;
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // available seats --> seatList !!! TODO
|
std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // available seats --> seatList !!! TODO
|
||||||
std::list<boost::shared_ptr<PlayerInterface> > activePlayerList; // used seats
|
PlayerList activePlayerList; // used seats
|
||||||
std::list<boost::shared_ptr<PlayerInterface> > runningPlayerList; // nonfolded and nonallin active players
|
PlayerList runningPlayerList; // nonfolded and nonallin active players
|
||||||
|
|
||||||
// boost::shared_ptr<PlayerInterface> playerArray[MAX_NUMBER_OF_PLAYERS];
|
// boost::shared_ptr<PlayerInterface> playerArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
|
|
||||||
|
|||||||
@@ -2083,7 +2083,7 @@ void mainWindowImpl::postRiverRunAnimation3() {
|
|||||||
actionLabelArray[i]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_winner.png"));
|
actionLabelArray[i]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_winner.png"));
|
||||||
|
|
||||||
//show winnercards if more than one player is active
|
//show winnercards if more than one player is active
|
||||||
if ( currentHand->getActivePlayersCounter() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) {
|
if ( currentHand->getActivePlayerList().size() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) {
|
||||||
|
|
||||||
int j;
|
int j;
|
||||||
int bestHandPos[5];
|
int bestHandPos[5];
|
||||||
@@ -2150,7 +2150,7 @@ void mainWindowImpl::postRiverRunAnimation3() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if( currentHand->getActivePlayersCounter() != 1 && currentHand->getPlayerArray()[i]->getMyAction() != 1 && currentHand->getPlayerArray()[i]->getMyActiveStatus() && myConfig->readConfigInt("ShowFadeOutCardsAnimation") ) {
|
if( currentHand->getActivePlayerList().size() != 1 && currentHand->getPlayerArray()[i]->getMyAction() != 1 && currentHand->getPlayerArray()[i]->getMyActiveStatus() && myConfig->readConfigInt("ShowFadeOutCardsAnimation") ) {
|
||||||
|
|
||||||
//aufgedeckte Gegner auch ausblenden
|
//aufgedeckte Gegner auch ausblenden
|
||||||
holeCardsArray[i][0]->startFadeOut(guiGameSpeed);
|
holeCardsArray[i][0]->startFadeOut(guiGameSpeed);
|
||||||
|
|||||||
Reference in New Issue
Block a user