adds activePlayerList and runningPlayerList (IV)

This commit is contained in:
doitux
2007-09-24 21:09:36 +00:00
parent 876508c540
commit f6a316fc2e
17 changed files with 79 additions and 63 deletions
+2 -1
View File
@@ -27,7 +27,8 @@
class PlayerInterface;
class HandInterface;
typedef std::list<boost::shared_ptr<PlayerInterface> > PlayerList;
typedef boost::shared_ptr<std::list<boost::shared_ptr<PlayerInterface> > > PlayerList;
typedef std::list<boost::shared_ptr<PlayerInterface> >::iterator PlayerListIterator;
class BoardInterface {
+1 -1
View File
@@ -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, 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 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, int dP, int sB) =0;
+2 -2
View File
@@ -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->getActivePlayerList().size() >= 3) { firstRound = 0; }
if(myHand->getActivePlayerList().size() < 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
+20 -11
View File
@@ -24,21 +24,30 @@
using namespace std;
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_PREFLOP), bigBlindPosition(0)
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_PREFLOP)
{
setHighestSet(2*getSmallBlind());
// // BigBlind ermitteln
bigBlindPosition = getDealerPosition();
// bigBlindPosition = getDealerPosition();
bigBlindPosition = getMyHand()->getActivePlayerList()->begin();
int i;
for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
// int i;
// for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
// bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
// }
PlayerListIterator it;
for(it=getMyHand()->getActivePlayerList()->begin(); it!=getMyHand()->getActivePlayerList()->end(); it++) {
if((*it)->getMyButton() == BUTTON_BIG_BLIND) {
bigBlindPosition = it;
}
}
// // erste Spielernummer fr preflopRun() setzen
setPlayersTurn(bigBlindPosition);
setPlayersTurn((*bigBlindPosition)->getMyID());
}
@@ -64,18 +73,18 @@ void LocalBeRoPreflop::run() {
}
// BigBlind ermitteln
bigBlindPosition = getDealerPosition();
// bigBlindPosition = getDealerPosition();
for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
}
// for(i=0; i<MAX_NUMBER_OF_PLAYERS && getMyHand()->getPlayerArray()[bigBlindPosition]->getMyButton() != BUTTON_BIG_BLIND; i++) {
// bigBlindPosition = (bigBlindPosition+1)%(MAX_NUMBER_OF_PLAYERS);
// }
// naechsten Spieler ermitteln
for(i=0; (i<MAX_NUMBER_OF_PLAYERS && (!(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyActiveStatus()) || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_FOLD || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_ALLIN)) || i==0; i++) {
setPlayersTurn((getPlayersTurn()+1)%(MAX_NUMBER_OF_PLAYERS));
// falls BigBlind, dann PreflopFirstRound zuende
if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND && getMyHand()->getPlayerArray()[bigBlindPosition]->getMySet() < 2*getSmallBlind()) setFirstRound(0);
if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND && (*bigBlindPosition)->getMySet() < 2*getSmallBlind()) setFirstRound(0);
}
+2 -1
View File
@@ -34,7 +34,8 @@ public:
void run();
private:
int bigBlindPosition;
// int bigBlindPosition;
PlayerListIterator bigBlindPosition;
};
#endif
@@ -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, PlayerList apl, PlayerList rpl, int id, int sP, int aP, int dP, int sB,int sC) { return new LocalHand(f, g, b, sl, apl, rpl, id, sP, aP, dP, sB, sC); }
HandInterface* LocalEngineFactory::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 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; }
+1 -1
View File
@@ -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, 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 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 dP, int sB);
+17 -17
View File
@@ -26,13 +26,13 @@
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 dP, int sB,int sC)
: 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;
PlayerListIterator it;
CardsValue myCardsValue;
@@ -51,8 +51,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
}
// Karten generieren und Board sowie Player zuweisen
int *cardsArray = new int[2*activePlayerList.size()+5];
Tools::getRandNumber(0, 51, 2*activePlayerList.size()+5, cardsArray, 1);
int *cardsArray = new int[2*activePlayerList->size()+5];
Tools::getRandNumber(0, 51, 2*activePlayerList->size()+5, cardsArray, 1);
int tempBoardArray[5];
int tempPlayerArray[2];
int tempPlayerAndBoardArray[7];
@@ -65,7 +65,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
k = 0;
myBoard->setMyCards(tempBoardArray);
for(it=activePlayerList.begin(); it!=activePlayerList.end(); it++, k++) {
for(it=activePlayerList->begin(); it!=activePlayerList->end(); it++, k++) {
(*it)->getMyBestHandPosition(bestHandPos);
@@ -85,8 +85,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
}
}
// sBluff für alle aktiver Spieler außer human player setzen
if(it!=activePlayerList.begin()) {
// sBluff für alle aktiver Spieler außer human player setzen --> TODO for ai-player in internet
if((*it)->getMyID() != 0) {
Tools::getRandNumber(1,100,1,&sBluff,0);
(*it)->setSBluff(sBluff);
(*it)->setSBluffStatus(0);
@@ -285,7 +285,7 @@ void LocalHand::start() {
void LocalHand::assignButtons() {
int i,j;
PlayerList::iterator it;
PlayerListIterator it;
// alle Buttons loeschen
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
@@ -300,7 +300,7 @@ void LocalHand::assignButtons() {
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
if(playerArray[i]->getMyActiveStatus()) {
if(activePlayerList.size() > 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
}
}
@@ -310,14 +310,14 @@ void LocalHand::assignButtons() {
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
if(playerArray[i]->getMyActiveStatus()) {
if(activePlayerList.size() > 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 (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) {
for (it=activePlayerList->begin(); it!=activePlayerList->end(); it++) {
//small blind
if((*it)->getMyButton() == 2) {
@@ -329,7 +329,7 @@ void LocalHand::assignButtons() {
// 1 to do not log this
(*it)->setMyAction(6,1);
// delete this player from runningPlayerList
it = runningPlayerList.erase(it);
it = runningPlayerList->erase(it);
}
else { (*it)->setMySet(smallBlind); }
@@ -345,7 +345,7 @@ void LocalHand::assignButtons() {
// 1 to do not log this
(*it)->setMyAction(6,1);
// delete this player from runningPlayerList
it = runningPlayerList.erase(it);
it = runningPlayerList->erase(it);
}
else { (*it)->setMySet(2*smallBlind); }
@@ -358,17 +358,17 @@ void LocalHand::assignButtons() {
void LocalHand::switchRounds() {
int i;
PlayerList::iterator it;
PlayerListIterator it;
// Anzahl der Spieler ermitteln, welche All In sind
int allInPlayersCounter = 0;
for (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) {
for (it=activePlayerList->begin(); it!=activePlayerList->end(); it++) {
if ((*it)->getMyAction() == 6) allInPlayersCounter++;
}
// TODO -> runningPlayerList.size()
int nonFoldPlayerCounter = 0;
for (it=activePlayerList.begin(); it!=activePlayerList.end(); it++) {
for (it=activePlayerList->begin(); it!=activePlayerList->end(); it++) {
if ((*it)->getMyAction() != 1) nonFoldPlayerCounter++;
}
@@ -407,7 +407,7 @@ void LocalHand::switchRounds() {
// 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) {
if(activePlayerList->size()==2 && playerArray[i]->getMyAction() == 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMyButton()==3 && playerArray[i]->getMySet()<=smallBlind) {
allInCondition = 1;
}
+1 -1
View File
@@ -34,7 +34,7 @@
class LocalHand : public HandInterface{
public:
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, std::vector<boost::shared_ptr<PlayerInterface> >, PlayerList, PlayerList, int, int, int, int, int, int);
LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, std::vector<boost::shared_ptr<PlayerInterface> >, PlayerList, PlayerList, int, int, int, int, int);
~LocalHand();
void start();
+10 -10
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->getActivePlayerList().size();
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->getActivePlayerList().size())*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->getActivePlayerList().size()-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->getActivePlayerList().size()))*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->getActivePlayerList().size();
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->getActivePlayerList().size())*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++) {
@@ -1843,7 +1843,7 @@ void LocalPlayer::turnEngine() {
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->getActivePlayerList().size())*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++) {
@@ -2179,7 +2179,7 @@ void LocalPlayer::riverEngine() {
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->getActivePlayerList().size())*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->getActivePlayerList().size();
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->getActivePlayerList().size();
int players = actualHand->getActivePlayerList()->size();
if(players > 5) players = 5;
// paranoia
if(players < 2) players = 2;
@@ -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, PlayerList apl, PlayerList rpl, int id, int sP, int aP, int dP, int sB,int sC)
HandInterface* ClientEngineFactory::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 dP, int sB,int sC)
{
return new ClientHand(f, g, b, sl, apl, rpl, id, sP, aP, 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, 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 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 dP, int sB);
+4 -2
View File
@@ -21,11 +21,13 @@
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 dP, int sB,int sC)
: 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), lastPlayersTurn(0), allInCondition(0),
cardsShown(false), bettingRoundsPlayed(0)
{
activePlayersCounter = activePlayerList->size();
int i;
lastPlayersTurn = 0;
+1 -1
View File
@@ -32,7 +32,7 @@
class ClientHand : public HandInterface
{
public:
ClientHand ( boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, std::vector<boost::shared_ptr<PlayerInterface> >, PlayerList, PlayerList , int, int, int, int, int, int );
ClientHand ( boost::shared_ptr<EngineFactory> f, GuiInterface*, BoardInterface*, std::vector<boost::shared_ptr<PlayerInterface> >, PlayerList, PlayerList , int, int, int, int, int );
~ClientHand();
void start();
+10 -8
View File
@@ -71,6 +71,9 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
// Player erstellen
activePlayerList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
runningPlayerList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
player_i = playerDataList.begin();
player_end = playerDataList.end();
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
@@ -98,8 +101,8 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
// fill player lists
playerArray.push_back(tmpPlayer);
if(startQuantityPlayers > i) {
activePlayerList.push_back(tmpPlayer);
runningPlayerList.push_back(tmpPlayer);
activePlayerList->push_back(tmpPlayer);
runningPlayerList->push_back(tmpPlayer);
}
@@ -111,7 +114,6 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
actualBoard->setPlayerLists(playerArray, activePlayerList, runningPlayerList);
}
Game::~Game()
{
// cout << "Delete Game Object" << "\n";
@@ -150,17 +152,17 @@ void Game::initHand()
if((actualHandID-1)%startHandsBeforeRaiseSmallBlind == 0 && actualHandID > 1) { actualSmallBlind *= 2; }
// Spieler mit leerem Cash auf inactive setzen
PlayerList::iterator it;
PlayerListIterator it;
for(it = activePlayerList.begin(); it != activePlayerList.end(); it++) {
for(it = activePlayerList->begin(); it != activePlayerList->end(); it++) {
if((*it)->getMyCash() == 0) {
(*it)->setMyActiveStatus(0);
it = activePlayerList.erase(it);
it = activePlayerList->erase(it);
}
}
// Anzahl noch aktiver Spieler ermitteln
actualQuantityPlayers = activePlayerList.size(); // TODO -> delete !!!
actualQuantityPlayers = activePlayerList->size(); // TODO -> delete !!!
//Spieler Action auf 0 setzen
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
@@ -168,7 +170,7 @@ void Game::initHand()
}
// Hand erstellen
actualHand = myFactory->createHand(myFactory, myGui, actualBoard, playerArray, activePlayerList, runningPlayerList, actualHandID, startQuantityPlayers, actualQuantityPlayers, dealerPosition, actualSmallBlind, startCash);
actualHand = myFactory->createHand(myFactory, myGui, actualBoard, playerArray, activePlayerList, runningPlayerList, actualHandID, startQuantityPlayers, dealerPosition, actualSmallBlind, startCash);
// Dealer-Button weiterschieben --> Achtung inactive
+2 -1
View File
@@ -35,7 +35,8 @@ class EngineFactory;
struct GameData;
struct StartData;
typedef std::list<boost::shared_ptr<PlayerInterface> > PlayerList;
typedef boost::shared_ptr<std::list<boost::shared_ptr<PlayerInterface> > > PlayerList;
typedef std::list<boost::shared_ptr<PlayerInterface> >::iterator PlayerListIterator;
class Game {
+2 -2
View File
@@ -2083,7 +2083,7 @@ void mainWindowImpl::postRiverRunAnimation3() {
actionLabelArray[i]->setPixmap(QPixmap(myAppDataPath +"gfx/gui/table/default/action_winner.png"));
//show winnercards if more than one player is active
if ( currentHand->getActivePlayerList().size() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) {
if ( currentHand->getActivePlayerList()->size() != 1 && myConfig->readConfigInt("ShowFadeOutCardsAnimation")) {
int j;
int bestHandPos[5];
@@ -2150,7 +2150,7 @@ void mainWindowImpl::postRiverRunAnimation3() {
}
else {
if( currentHand->getActivePlayerList().size() != 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
holeCardsArray[i][0]->startFadeOut(guiGameSpeed);