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
+1 -1
View File
@@ -11,7 +11,7 @@
//
#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)
{
}
+1 -1
View File
@@ -22,7 +22,7 @@ class HandInterface;
*/
class ClientBeRo : public BeRoInterface{
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();
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));
}
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;
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, aP, 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, aP, 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_PREFLOP)));
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, dP, sB, GAME_STATE_TURN)));
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, dP, sB, GAME_STATE_POST_RIVER)));
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);
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);
};
+2 -30
View File
@@ -22,7 +22,7 @@
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)
: 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),
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.
// 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;
}
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
ClientHand::setStartQuantityPlayers(int theValue)
{
@@ -229,20 +215,6 @@ ClientHand::getStartCash() const
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
ClientHand::setBettingRoundsPlayed(int theValue)
{
+3 -4
View File
@@ -38,6 +38,9 @@ class ClientHand : public HandInterface
void start();
std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const;
PlayerList getActivePlayerList() const {return activePlayerList;}
PlayerList getRunningPlayerList() const {return runningPlayerList;}
BoardInterface* getBoard() const;
boost::shared_ptr<BeRoInterface> getPreflop() const;
boost::shared_ptr<BeRoInterface> getFlop() const;
@@ -70,9 +73,6 @@ class ClientHand : public HandInterface
void setStartCash ( int theValue );
int getStartCash() const;
void setActivePlayersCounter ( int theValue );
int getActivePlayersCounter() const;
void setBettingRoundsPlayed ( int theValue );
int getBettingRoundsPlayed() const;
@@ -99,7 +99,6 @@ class ClientHand : public HandInterface
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