adds activePlayerList and runningPlayerList (XIV) - !!! BROKEN !!! - last sable rev866

This commit is contained in:
doitux
2007-09-26 19:45:58 +00:00
parent 7bbf76fe5d
commit 1f21fe815e
23 changed files with 252 additions and 79 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
//
#include "clientbero.h"
ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, int dP, int sB, GameState gS)
ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, unsigned 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 dP, int sB, GameState gS);
ClientBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS);
~ClientBeRo();
GameState getMyBeRoID() const;
@@ -50,7 +50,7 @@ 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 dP, int sB) {
std::vector<boost::shared_ptr<BeRoInterface> > ClientEngineFactory::createBeRo(HandInterface* hi, int id, unsigned dP, int sB) {
std::vector<boost::shared_ptr<BeRoInterface> > 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 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);
std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface* hi, int id, unsigned dP, int sB);
};
+28
View File
@@ -76,6 +76,34 @@ ClientHand::getPlayerArray() const
return playerArray;
}
PlayerListIterator
ClientHand::getActivePlayerIt(unsigned uniqueId) const
{
PlayerListIterator it;
for(it=activePlayerList->begin(); it!=activePlayerList->end(); it++) {
if((*it)->getMyUniqueID() == uniqueId) {
break;
}
}
return it;
}
PlayerListIterator
ClientHand::getRunningPlayerIt(unsigned uniqueId) const
{
PlayerListIterator it;
for(it=runningPlayerList->begin(); it!=runningPlayerList->end(); it++) {
if((*it)->getMyUniqueID() == uniqueId) {
break;
}
}
return it;
}
BoardInterface*
ClientHand::getBoard() const
{
+3
View File
@@ -41,6 +41,9 @@ class ClientHand : public HandInterface
PlayerList getActivePlayerList() const {return activePlayerList;}
PlayerList getRunningPlayerList() const {return runningPlayerList;}
PlayerListIterator getActivePlayerIt(unsigned) const;
PlayerListIterator getRunningPlayerIt(unsigned) const;
BoardInterface* getBoard() const;
boost::shared_ptr<BeRoInterface> getPreflop() const;
boost::shared_ptr<BeRoInterface> getFlop() const;