initialize some variables in constructor

This commit is contained in:
floty
2010-11-01 21:12:29 +00:00
parent 14cc84f399
commit a1837a43f6
+9 -2
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), myStayOnTableStatus(1), myTurn(0), myRoundStartCash(0), lastMoneyWon(0), sBluff(0), sBluffStatus(0), m_actionTimeoutCounter(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), myStayOnTableStatus(1), myTurn(0), myCardsFlip(0), myRoundStartCash(0), lastMoneyWon(0), sBluff(0), sBluffStatus(0), myWinnerState(false), m_actionTimeoutCounter(0)
{
// !!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!
@@ -899,8 +899,15 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
}
////////////////////////////
// myBestHandPosition mit -1 initialisieren
int i;
for(i=0; i<3; i++) {
myNiveau[i] = 0;
}
for(i=0; i<2; i++) {
myCards[i] = -1;
}
// myBestHandPosition mit -1 initialisieren
for(i=0; i<5; i++) {
myBestHandPosition[i] = -1;
}