lastMoneyWon

This commit is contained in:
floty
2007-10-29 22:26:50 +00:00
parent 70e2d5556f
commit 1a5a5600ce
6 changed files with 32 additions and 4 deletions
+7 -3
View File
@@ -76,12 +76,13 @@ void LocalBoard::distributePot() {
// filling player sets vector
vector<unsigned> playerSets;
for(it_c=seatsList->begin(); it_c!=seatsList->end(); it_c++) {
if((*it_c)->getMyActiveStatus()) {
playerSets.push_back( ( ((*it_c)->getMyRoundStartCash()) - ((*it_c)->getMyCash()) ) );
for(it=seatsList->begin(); it!=seatsList->end(); it++) {
if((*it)->getMyActiveStatus()) {
playerSets.push_back( ( ((*it)->getMyRoundStartCash()) - ((*it)->getMyCash()) ) );
} else {
playerSets.push_back(0);
}
(*it)->setLastMoneyWon(0);
}
// sort player sets asc
@@ -147,6 +148,7 @@ void LocalBoard::distributePot() {
// filling winners vector
winners.push_back((*it)->getMyUniqueID());
(*it)->setLastMoneyWon( (*it)->getLastMoneyWon() + (potLevel[1])/winnerCount );
}
}
@@ -189,10 +191,12 @@ void LocalBoard::distributePot() {
(*it)->setMyCash( (*it)->getMyCash() + (int)((potLevel[1])/winnerCount) + 1);
// filling winners vector
winners.push_back((*it)->getMyUniqueID());
(*it)->setLastMoneyWon( (*it)->getLastMoneyWon() + ((potLevel[1])/winnerCount) + 1 );
} else {
(*it)->setMyCash( (*it)->getMyCash() + (int)((potLevel[1])/winnerCount));
// filling winners vector
winners.push_back((*it)->getMyUniqueID());
(*it)->setLastMoneyWon( (*it)->getLastMoneyWon() + (potLevel[1])/winnerCount );
}
}
}
+1 -1
View File
@@ -850,7 +850,7 @@ static const RoundData FlopValues[] =
#define NUM_FLOP_VALUES (sizeof(FlopValues)/sizeof(RoundData))
LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
: PlayerInterface(), myConfig(c), currentHand(0), currentBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0)
: PlayerInterface(), myConfig(c), currentHand(0), currentBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), lastMoneyWon(0), sBluff(0), sBluffStatus(0)
{
// !!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!
+5
View File
@@ -117,6 +117,9 @@ public:
void setMyRoundStartCash(int theValue) { myRoundStartCash = theValue;}
int getMyRoundStartCash() const { return myRoundStartCash; }
void setLastMoneyWon ( int theValue ) { lastMoneyWon = theValue; }
int getLastMoneyWon() const { return lastMoneyWon; }
void setMyAverageSets(int theValue) { myAverageSets[0] = myAverageSets[1]; myAverageSets[1] = myAverageSets[2]; myAverageSets[2] = myAverageSets[3]; myAverageSets[3] = theValue; }
int getMyAverageSets() const { return (myAverageSets[0]+myAverageSets[1]+myAverageSets[2]+myAverageSets[3])/4; }
@@ -176,6 +179,7 @@ public:
private:
ConfigFile *myConfig;
@@ -210,6 +214,7 @@ private:
bool myTurn; // 0 = no, 1 = yes
bool myCardsFlip; // 0 = cards are not fliped, 1 = cards are already flipped,
int myRoundStartCash;
int lastMoneyWon;
int myAverageSets[4];
bool myAggressive[7];
@@ -306,6 +306,18 @@ ClientPlayer::getMyRoundStartCash() const
return myRoundStartCash;
}
void
ClientPlayer::setLastMoneyWon ( int theValue )
{
lastMoneyWon = theValue;
}
int
ClientPlayer::getLastMoneyWon() const
{
return lastMoneyWon;
}
void
ClientPlayer::setMyAverageSets(int theValue)
{
+4
View File
@@ -89,6 +89,9 @@ public:
void setMyRoundStartCash(int theValue);
int getMyRoundStartCash() const;
void setLastMoneyWon ( int theValue );
int getLastMoneyWon() const;
void setMyAverageSets(int theValue);
int getMyAverageSets() const;
@@ -163,6 +166,7 @@ private:
bool myTurn; // 0 = no, 1 = yes
bool myCardsFlip; // 0 = cards are not fliped, 1 = cards are already flipped,
int myRoundStartCash;
int lastMoneyWon;
int myAverageSets[4];
bool myAggressive[7];
+3
View File
@@ -89,6 +89,9 @@ public:
virtual void setMyAverageSets(int theValue) =0;
virtual int getMyAverageSets() const =0;
virtual void setLastMoneyWon ( int theValue ) =0;
virtual int getLastMoneyWon() const =0;
virtual void setMyAggressive(bool theValue) =0;
virtual int getMyAggressive() const =0;