another way to initialize stayOnTableStatus for player-objects
This commit is contained in:
@@ -33,7 +33,7 @@ public:
|
|||||||
|
|
||||||
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
|
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
|
||||||
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp) =0;
|
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp) =0;
|
||||||
virtual boost::shared_ptr<PlayerInterface> createPlayer(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(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB) =0;
|
||||||
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB) =0;
|
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -95,7 +95,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create player objects
|
// create player objects
|
||||||
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(i, uniqueId, type, myName, myAvatarFile, myStartCash, startQuantityPlayers > i, 0);
|
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(i, uniqueId, type, myName, myAvatarFile, myStartCash, startQuantityPlayers > i, startQuantityPlayers > i, 0);
|
||||||
tmpPlayer->setIsSessionActive(true);
|
tmpPlayer->setIsSessionActive(true);
|
||||||
tmpPlayer->setMyGuid(myGuid);
|
tmpPlayer->setMyGuid(myGuid);
|
||||||
|
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ LocalEngineFactory::createBoard(unsigned dp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<PlayerInterface>
|
boost::shared_ptr<PlayerInterface>
|
||||||
LocalEngineFactory::createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
LocalEngineFactory::createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB)
|
||||||
{
|
{
|
||||||
return boost::shared_ptr<PlayerInterface> (new LocalPlayer(myConfig, id, uniqueId, type, name, avatar, sC, aS, mB));
|
return boost::shared_ptr<PlayerInterface> (new LocalPlayer(myConfig, id, uniqueId, type, name, avatar, sC, aS, sotS, mB));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> >
|
std::vector<boost::shared_ptr<BeRoInterface> >
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||||
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
|
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
|
||||||
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB);
|
||||||
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
|
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -845,10 +845,10 @@ static const RoundData FlopValues[] = {
|
|||||||
#define NUM_PREFLOP_VALUES (sizeof(PreflopValues)/sizeof(RoundData))
|
#define NUM_PREFLOP_VALUES (sizeof(PreflopValues)/sizeof(RoundData))
|
||||||
#define NUM_FLOP_VALUES (sizeof(FlopValues)/sizeof(RoundData))
|
#define NUM_FLOP_VALUES (sizeof(FlopValues)/sizeof(RoundData))
|
||||||
|
|
||||||
LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB)
|
||||||
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar),
|
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar),
|
||||||
myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), logHoleCardsDone(false), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(PLAYER_ACTION_NONE),
|
myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), logHoleCardsDone(false), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(PLAYER_ACTION_NONE),
|
||||||
myButton(mB), myActiveStatus(aS), myStayOnTableStatus(1), myTurn(0), myCardsFlip(0), myRoundStartCash(0), lastMoneyWon(0),
|
myButton(mB), myActiveStatus(aS), myStayOnTableStatus(sotS), myTurn(0), myCardsFlip(0), myRoundStartCash(0), lastMoneyWon(0),
|
||||||
sBluff(0), sBluffStatus(false), m_actionTimeoutCounter(0), m_isSessionActive(false), m_isKicked(false)
|
sBluff(0), sBluffStatus(false), m_actionTimeoutCounter(0), m_isSessionActive(false), m_isKicked(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class HandInterface;
|
|||||||
class LocalPlayer : public PlayerInterface
|
class LocalPlayer : public PlayerInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LocalPlayer(ConfigFile*, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
LocalPlayer(ConfigFile*, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB);
|
||||||
|
|
||||||
~LocalPlayer();
|
~LocalPlayer();
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ ClientEngineFactory::createBoard(unsigned dp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<PlayerInterface>
|
boost::shared_ptr<PlayerInterface>
|
||||||
ClientEngineFactory::createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
ClientEngineFactory::createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB)
|
||||||
{
|
{
|
||||||
return boost::shared_ptr<PlayerInterface>(new ClientPlayer(NULL, id, uniqueId, type, name, avatar, sC, aS, mB));
|
return boost::shared_ptr<PlayerInterface>(new ClientPlayer(NULL, id, uniqueId, type, name, avatar, sC, aS, sotS, mB));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<BeRoInterface> >
|
std::vector<boost::shared_ptr<BeRoInterface> >
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
|
|
||||||
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
|
||||||
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
|
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
|
||||||
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB);
|
||||||
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
|
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
ClientPlayer::ClientPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
ClientPlayer::ClientPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB)
|
||||||
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type),
|
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type),
|
||||||
myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), logHoleCardsDone(false), myCash(sC), mySet(0), myLastRelativeSet(0),
|
myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), logHoleCardsDone(false), myCash(sC), mySet(0), myLastRelativeSet(0),
|
||||||
myAction(PLAYER_ACTION_NONE), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(true), myTurn(false), myCardsFlip(false), myRoundStartCash(0),
|
myAction(PLAYER_ACTION_NONE), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(sotS), myTurn(false), myCardsFlip(false), myRoundStartCash(0),
|
||||||
lastMoneyWon(0), sBluff(0), sBluffStatus(false), m_isSessionActive(false), m_isKicked(false)
|
lastMoneyWon(0), sBluff(0), sBluffStatus(false), m_isSessionActive(false), m_isKicked(false)
|
||||||
{
|
{
|
||||||
myBestHandPosition[0] = myBestHandPosition[1] = myBestHandPosition[2] = myBestHandPosition[3] = myBestHandPosition[4] = 0;
|
myBestHandPosition[0] = myBestHandPosition[1] = myBestHandPosition[2] = myBestHandPosition[3] = myBestHandPosition[4] = 0;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class HandInterface;
|
|||||||
class ClientPlayer : public PlayerInterface
|
class ClientPlayer : public PlayerInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ClientPlayer(ConfigFile*, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
|
ClientPlayer(ConfigFile*, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB);
|
||||||
~ClientPlayer();
|
~ClientPlayer();
|
||||||
|
|
||||||
void setHand(HandInterface *);
|
void setHand(HandInterface *);
|
||||||
|
|||||||
@@ -968,10 +968,12 @@ void gameTableImpl::refreshPlayerAvatar()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SEAT_AUTOFOLD: {
|
case SEAT_AUTOFOLD: {
|
||||||
|
qDebug() << seatPlace << "AUTOFOLD";
|
||||||
playerAvatarLabelArray[(*it_c)->getMyID()]->setPixmapAndCountry(avatarPic, countryString, seatPlace, TRUE);
|
playerAvatarLabelArray[(*it_c)->getMyID()]->setPixmapAndCountry(avatarPic, countryString, seatPlace, TRUE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SEAT_STAYONTABLE: {
|
case SEAT_STAYONTABLE: {
|
||||||
|
qDebug() << seatPlace << "STAYONTABLE";
|
||||||
playerAvatarLabelArray[(*it_c)->getMyID()]->setPixmapAndCountry(avatarPic, countryString, seatPlace, TRUE);
|
playerAvatarLabelArray[(*it_c)->getMyID()]->setPixmapAndCountry(avatarPic, countryString, seatPlace, TRUE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1087,8 +1089,8 @@ void gameTableImpl::refreshCash()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SEAT_AUTOFOLD: {
|
case SEAT_AUTOFOLD: {
|
||||||
cashLabelArray[(*it_c)->getMyID()]->setText("$"+QString("%L1").arg((*it_c)->getMyCash()));
|
|
||||||
cashLabelArray[(*it_c)->getMyID()]->setGraphicsEffect(&opacity);
|
cashLabelArray[(*it_c)->getMyID()]->setGraphicsEffect(&opacity);
|
||||||
|
cashLabelArray[(*it_c)->getMyID()]->setText("$"+QString("%L1").arg((*it_c)->getMyCash()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SEAT_STAYONTABLE: {
|
case SEAT_STAYONTABLE: {
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ void startWindowImpl::callSettingsDialog()
|
|||||||
|
|
||||||
void startWindowImpl::showTimeoutDialog(int msgID, unsigned duration)
|
void startWindowImpl::showTimeoutDialog(int msgID, unsigned duration)
|
||||||
{
|
{
|
||||||
|
qDebug() << "show timeout";
|
||||||
if(myTimeoutDialog->isHidden()) {
|
if(myTimeoutDialog->isHidden()) {
|
||||||
myTimeoutDialog->setMySession(mySession);
|
myTimeoutDialog->setMySession(mySession);
|
||||||
myTimeoutDialog->setMsgID((NetTimeoutReason)msgID);
|
myTimeoutDialog->setMsgID((NetTimeoutReason)msgID);
|
||||||
|
|||||||
Reference in New Issue
Block a user