run astyle

This commit is contained in:
Albert Medela committed 2017-08-16 13:55:18 +02:00
1 parent 94d87ed33e
commit 65e10c71b0
89 files changed
+888 -488

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ public:
virtual void collectSets() =0;
virtual void collectPot() =0;
virtual void distributePot(unsigned) =0;
virtual void distributePot(unsigned) =0;
virtual void determinePlayerNeedToShowCards() =0;
virtual std::list<unsigned> getWinners() const =0;
+1 -1
View File
@@ -45,7 +45,7 @@ public:
virtual ~EngineFactory();
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() =0;
virtual boost::shared_ptr<BoardInterface> createBoard() =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;
};
+1 -1
View File
@@ -77,7 +77,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
throw LocalException(__FILE__, __LINE__, ERR_DEALER_NOT_FOUND);
// create board
currentBoard = myFactory->createBoard();
currentBoard = myFactory->createBoard();
// create player lists
seatsList.reset(new std::list<boost::shared_ptr<PlayerInterface> >);
+32 -16
View File
@@ -63,60 +63,76 @@ public:
boost::shared_ptr<HandInterface> getCurrentHand();
const boost::shared_ptr<HandInterface> getCurrentHand() const;
PlayerList getSeatsList() const {
PlayerList getSeatsList() const
{
return seatsList;
}
PlayerList getActivePlayerList() const {
PlayerList getActivePlayerList() const
{
return activePlayerList;
}
PlayerList getRunningPlayerList() const {
PlayerList getRunningPlayerList() const
{
return runningPlayerList;
}
void setStartQuantityPlayers(int theValue) {
void setStartQuantityPlayers(int theValue)
{
startQuantityPlayers = theValue;
}
int getStartQuantityPlayers() const {
int getStartQuantityPlayers() const
{
return startQuantityPlayers;
}
void setStartSmallBlind(int theValue) {
void setStartSmallBlind(int theValue)
{
startSmallBlind = theValue;
}
int getStartSmallBlind() const {
int getStartSmallBlind() const
{
return startSmallBlind;
}
void setStartCash(int theValue) {
void setStartCash(int theValue)
{
startCash = theValue;
}
int getStartCash() const {
int getStartCash() const
{
return startCash;
}
int getMyGameID() const {
int getMyGameID() const
{
return myGameID;
}
void setCurrentSmallBlind(int theValue) {
void setCurrentSmallBlind(int theValue)
{
currentSmallBlind = theValue;
}
int getCurrentSmallBlind() const {
int getCurrentSmallBlind() const
{
return currentSmallBlind;
}
void setCurrentHandID(int theValue) {
void setCurrentHandID(int theValue)
{
currentHandID = theValue;
}
int getCurrentHandID() const {
int getCurrentHandID() const
{
return currentHandID;
}
unsigned getDealerPosition() const {
unsigned getDealerPosition() const
{
return dealerPosition;
}
void replaceDealer(unsigned oldDealer, unsigned newDealer) {
void replaceDealer(unsigned oldDealer, unsigned newDealer)
{
if (dealerPosition == oldDealer)
dealerPosition = newDealer;
}
+6 -6
View File
@@ -65,7 +65,7 @@ int CardsValue::holeCardsClass(int one, int two)
}
}
switch((one-1)%13+2) {
//Ass
//Ass
case 14: {
if((one-1)/13 == (two-1)/13) {
switch((one-1)%13-(two-1)%13) {
@@ -756,7 +756,7 @@ std::string CardsValue::determineHandName(int myCardsValueInt, PlayerList active
std::string handName;
switch(myCardsValueInt/100000000) {
// Royal Flush
// Royal Flush
case 9: {
handName = *cardStringIt_c;
@@ -1161,8 +1161,8 @@ std::string CardsValue::determineHandName(int myCardsValueInt, PlayerList active
}
}
break;
default:
{}
default: {
}
}
return handName;
@@ -1191,11 +1191,11 @@ std::list<std::string> CardsValue::translateCardsValueCode(int cardsValueCode)
switch (firstPart) {
// Royal Flush
// Royal Flush
case 9:
cardString.push_back("Royal Flush");
break;
// Straight Flush
// Straight Flush
case 8: {
cardString.push_back("Straight Flush, ");
switch(secondPart) {
+1 -1
View File
@@ -38,7 +38,7 @@
using namespace std;
LocalBeRo::LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), fullBetRule(false), firstRun(true), firstRunGui(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false)
: BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), fullBetRule(false), firstRun(true), firstRunGui(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false)
{
currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
lastPlayersTurnIt = myHand->getRunningPlayerList()->begin();
+61 -31
View File
@@ -44,28 +44,34 @@ public:
LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
~LocalBeRo();
GameState getMyBeRoID() const {
GameState getMyBeRoID() const
{
return myBeRoID;
}
int getHighestCardsValue() const;
void setHighestCardsValue(int /*theValue*/) { }
void setMinimumRaise ( int theValue ) {
void setMinimumRaise ( int theValue )
{
minimumRaise = theValue;
}
int getMinimumRaise() const {
int getMinimumRaise() const
{
return minimumRaise;
}
void setFullBetRule ( bool theValue ) {
void setFullBetRule ( bool theValue )
{
fullBetRule = theValue;
}
bool getFullBetRule() const {
bool getFullBetRule() const
{
return fullBetRule;
}
void skipFirstRunGui() {
void skipFirstRunGui()
{
firstRunGui = false;
}
@@ -77,89 +83,113 @@ public:
protected:
HandInterface* getMyHand() const {
HandInterface* getMyHand() const
{
return myHand;
}
unsigned getDealerPosition() const {
unsigned getDealerPosition() const
{
return dealerPosition;
}
void setCurrentPlayersTurnId(unsigned theValue) {
void setCurrentPlayersTurnId(unsigned theValue)
{
currentPlayersTurnId = theValue;
}
unsigned getCurrentPlayersTurnId() const {
unsigned getCurrentPlayersTurnId() const
{
return currentPlayersTurnId;
}
void setFirstRoundLastPlayersTurnId(unsigned theValue) {
void setFirstRoundLastPlayersTurnId(unsigned theValue)
{
firstRoundLastPlayersTurnId = theValue;
}
unsigned getFirstRoundLastPlayersTurnId() const {
unsigned getFirstRoundLastPlayersTurnId() const
{
return firstRoundLastPlayersTurnId;
}
void setCurrentPlayersTurnIt(PlayerListIterator theValue) {
void setCurrentPlayersTurnIt(PlayerListIterator theValue)
{
currentPlayersTurnIt = theValue;
}
PlayerListIterator getCurrentPlayersTurnIt() const {
PlayerListIterator getCurrentPlayersTurnIt() const
{
return currentPlayersTurnIt;
}
void setLastPlayersTurnIt(PlayerListIterator theValue) {
void setLastPlayersTurnIt(PlayerListIterator theValue)
{
lastPlayersTurnIt = theValue;
}
PlayerListIterator getLastPlayersTurnIt() const {
PlayerListIterator getLastPlayersTurnIt() const
{
return lastPlayersTurnIt;
}
void setHighestSet(int theValue) {
void setHighestSet(int theValue)
{
highestSet = theValue;
}
int getHighestSet() const {
int getHighestSet() const
{
return highestSet;
}
void setFirstRun(bool theValue) {
void setFirstRun(bool theValue)
{
firstRun = theValue;
}
bool getFirstRun() const {
bool getFirstRun() const
{
return firstRun;
}
void setFirstRound(bool theValue) {
void setFirstRound(bool theValue)
{
firstRound = theValue;
}
bool getFirstRound() const {
bool getFirstRound() const
{
return firstRound;
}
void setSmallBlindPositionId(unsigned theValue) {
void setSmallBlindPositionId(unsigned theValue)
{
smallBlindPositionId = theValue;
}
unsigned getSmallBlindPositionId() const {
unsigned getSmallBlindPositionId() const
{
return smallBlindPositionId;
}
void setBigBlindPositionId(unsigned theValue) {
void setBigBlindPositionId(unsigned theValue)
{
bigBlindPositionId = theValue;
}
unsigned getBigBlindPositionId() const {
unsigned getBigBlindPositionId() const
{
return bigBlindPositionId;
}
void setSmallBlindPosition(int theValue) {
void setSmallBlindPosition(int theValue)
{
smallBlindPosition = theValue;
}
int getSmallBlindPosition() const {
int getSmallBlindPosition() const
{
return smallBlindPosition;
}
void setSmallBlind(int theValue) {
void setSmallBlind(int theValue)
{
smallBlind = theValue;
}
int getSmallBlind() const {
int getSmallBlind() const
{
return smallBlind;
}
@@ -171,7 +201,7 @@ private:
HandInterface* myHand;
const GameState myBeRoID;
unsigned dealerPosition;
unsigned dealerPosition;
int smallBlindPosition;
unsigned smallBlindPositionId;
@@ -91,7 +91,7 @@ void LocalBeRoPostRiver::postRiverRun()
getMyHand()->getBoard()->determinePlayerNeedToShowCards();
// Pot-Verteilung
getMyHand()->getBoard()->distributePot(getDealerPosition());
getMyHand()->getBoard()->distributePot(getDealerPosition());
//Pot auf 0 setzen
getMyHand()->getBoard()->setPot(0);
+4 -2
View File
@@ -44,10 +44,12 @@ public:
LocalBeRoPostRiver(HandInterface*, int, int);
~LocalBeRoPostRiver();
void setHighestCardsValue(int theValue) {
void setHighestCardsValue(int theValue)
{
highestCardsValue = theValue;
}
int getHighestCardsValue() const {
int getHighestCardsValue() const
{
return highestCardsValue;
}
+26 -14
View File
@@ -45,57 +45,69 @@ class HandInterface;
class LocalBoard : public BoardInterface
{
public:
LocalBoard();
LocalBoard();
~LocalBoard();
void setPlayerLists(PlayerList, PlayerList, PlayerList);
void setMyCards(int* theValue) {
void setMyCards(int* theValue)
{
int i;
for(i=0; i<5; i++) myCards[i] = theValue[i];
}
void getMyCards(int* theValue) {
void getMyCards(int* theValue)
{
int i;
for(i=0; i<5; i++) theValue[i] = myCards[i];
}
void setAllInCondition(bool theValue) {
void setAllInCondition(bool theValue)
{
allInCondition = theValue;
}
void setLastActionPlayerID(unsigned theValue) {
void setLastActionPlayerID(unsigned theValue)
{
lastActionPlayerID = theValue;
}
int getPot() const {
int getPot() const
{
return pot;
}
void setPot(int theValue) {
void setPot(int theValue)
{
pot = theValue;
}
int getSets() const {
int getSets() const
{
return sets;
}
void setSets(int theValue) {
void setSets(int theValue)
{
sets = theValue;
}
void collectSets() ;
void collectPot() ;
void distributePot(unsigned dealerPosition);
void distributePot(unsigned dealerPosition);
void determinePlayerNeedToShowCards();
std::list<unsigned> getWinners() const {
std::list<unsigned> getWinners() const
{
return winners;
}
void setWinners(const std::list<unsigned> &w) {
void setWinners(const std::list<unsigned> &w)
{
winners = w;
}
std::list<unsigned> getPlayerNeedToShowCards() const {
std::list<unsigned> getPlayerNeedToShowCards() const
{
return playerNeedToShowCards;
}
void setPlayerNeedToShowCards(const std::list<unsigned> &p) {
void setPlayerNeedToShowCards(const std::list<unsigned> &p)
{
playerNeedToShowCards = p;
}
@@ -63,7 +63,7 @@ LocalEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface
boost::shared_ptr<BoardInterface>
LocalEngineFactory::createBoard()
{
return boost::shared_ptr<BoardInterface>(new LocalBoard());
return boost::shared_ptr<BoardInterface>(new LocalBoard());
}
boost::shared_ptr<PlayerInterface>
+1 -1
View File
@@ -50,7 +50,7 @@ public:
~LocalEngineFactory();
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();
virtual boost::shared_ptr<BoardInterface> createBoard();
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);
+4 -4
View File
@@ -362,8 +362,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
}
break;
default:
{}
default: {
}
}
@@ -696,8 +696,8 @@ void LocalHand::switchRounds()
myGui->postRiverAnimation1();
}
break;
default:
{}
default: {
}
}
+62 -31
View File
@@ -51,111 +51,142 @@ public:
void start();
PlayerList getSeatsList() const {
PlayerList getSeatsList() const
{
return seatsList;
}
PlayerList getActivePlayerList() const {
PlayerList getActivePlayerList() const
{
return activePlayerList;
}
PlayerList getRunningPlayerList() const {
PlayerList getRunningPlayerList() const
{
return runningPlayerList;
}
boost::shared_ptr<BoardInterface> getBoard() const {
boost::shared_ptr<BoardInterface> getBoard() const
{
return myBoard;
}
boost::shared_ptr<BeRoInterface> getPreflop() const {
boost::shared_ptr<BeRoInterface> getPreflop() const
{
return myBeRo[GAME_STATE_PREFLOP];
}
boost::shared_ptr<BeRoInterface> getFlop() const {
boost::shared_ptr<BeRoInterface> getFlop() const
{
return myBeRo[GAME_STATE_FLOP];
}
boost::shared_ptr<BeRoInterface> getTurn() const {
boost::shared_ptr<BeRoInterface> getTurn() const
{
return myBeRo[GAME_STATE_TURN];
}
boost::shared_ptr<BeRoInterface> getRiver() const {
boost::shared_ptr<BeRoInterface> getRiver() const
{
return myBeRo[GAME_STATE_RIVER];
}
GuiInterface* getGuiInterface() const {
GuiInterface* getGuiInterface() const
{
return myGui;
}
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const {
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const
{
return myBeRo[currentRound];
}
Log* getLog() const {
Log* getLog() const
{
return myLog;
}
void setMyID(int theValue) {
void setMyID(int theValue)
{
myID = theValue;
}
int getMyID() const {
int getMyID() const
{
return myID;
}
void setStartQuantityPlayers(int theValue) {
void setStartQuantityPlayers(int theValue)
{
startQuantityPlayers = theValue;
}
int getStartQuantityPlayers() const {
int getStartQuantityPlayers() const
{
return startQuantityPlayers;
}
void setCurrentRound(GameState theValue) {
void setCurrentRound(GameState theValue)
{
currentRound = theValue;
if(myLog) myLog->setCurrentRound(currentRound);
}
GameState getCurrentRound() const {
GameState getCurrentRound() const
{
return currentRound;
}
GameState getRoundBeforePostRiver() const {
GameState getRoundBeforePostRiver() const
{
return roundBeforePostRiver;
}
void setDealerPosition(int theValue) {
void setDealerPosition(int theValue)
{
dealerPosition = theValue;
}
int getDealerPosition() const {
int getDealerPosition() const
{
return dealerPosition;
}
void setSmallBlind(int theValue) {
void setSmallBlind(int theValue)
{
smallBlind = theValue;
}
int getSmallBlind() const {
int getSmallBlind() const
{
return smallBlind;
}
void setAllInCondition(bool theValue) {
void setAllInCondition(bool theValue)
{
allInCondition = theValue;
}
bool getAllInCondition() const {
bool getAllInCondition() const
{
return allInCondition;
}
void setStartCash(int theValue) {
void setStartCash(int theValue)
{
startCash = theValue;
}
int getStartCash() const {
int getStartCash() const
{
return startCash;
}
void setPreviousPlayerID(int theValue) {
void setPreviousPlayerID(int theValue)
{
previousPlayerID = theValue;
}
int getPreviousPlayerID() const {
int getPreviousPlayerID() const
{
return previousPlayerID;
}
void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayerID() const {
unsigned getLastActionPlayerID() const
{
return lastActionPlayerID;
}
void setCardsShown(bool theValue) {
void setCardsShown(bool theValue)
{
cardsShown = theValue;
}
bool getCardsShown() const {
bool getCardsShown() const
{
return cardsShown;
}
+17 -17
View File
@@ -1066,8 +1066,8 @@ void LocalPlayer::action()
}
break;
default:
{}
default: {
}
}
// cout << currentHand->getCurrentBeRo()->getMinimumRaise() << endl;
@@ -1365,8 +1365,8 @@ void LocalPlayer::preflopEngine()
if(DEBUG_MODE) {
switch(myUniqueID) {
case 0:
{}
case 0: {
}
break;
case 1: {
// player 1
@@ -1494,8 +1494,8 @@ void LocalPlayer::preflopEngine()
// }
}
break;
default:
{}
default: {
}
}
@@ -1926,8 +1926,8 @@ void LocalPlayer::flopEngine()
myAction = PLAYER_ACTION_CHECK;
}
break;
default:
{}
default: {
}
}
@@ -2696,8 +2696,8 @@ void LocalPlayer::turnEngine()
}
break;
default:
{}
default: {
}
}
@@ -3206,8 +3206,8 @@ void LocalPlayer::riverEngine()
}
break;
default:
{}
default: {
}
}
@@ -3227,9 +3227,9 @@ void LocalPlayer::evaluation(int bet, int raise)
int highestSet = currentHand->getCurrentBeRo()->getHighestSet();
switch(myAction) {
// none
case 0:
{}
// none
case 0: {
}
break;
// fold
case 1: {
@@ -3337,8 +3337,8 @@ void LocalPlayer::evaluation(int bet, int raise)
case 6: {
}
break;
default:
{}
default: {
}
}
currentHand->getCurrentBeRo()->setHighestSet(highestSet);
+106 -53
View File
@@ -50,129 +50,163 @@ public:
void setHand(HandInterface *);
int getMyID() const {
int getMyID() const
{
return myID;
}
unsigned getMyUniqueID() const {
unsigned getMyUniqueID() const
{
return myUniqueID;
}
void setMyUniqueID(unsigned newId) {
void setMyUniqueID(unsigned newId)
{
myUniqueID = newId;
}
void setMyGuid(const std::string &theValue) {
void setMyGuid(const std::string &theValue)
{
myGuid = theValue;
}
std::string getMyGuid() const {
std::string getMyGuid() const
{
return myGuid;
}
PlayerType getMyType() const {
PlayerType getMyType() const
{
return myType;
}
void setMyDude(int theValue) {
void setMyDude(int theValue)
{
myDude = theValue;
}
int getMyDude() const {
int getMyDude() const
{
return myDude;
}
void setMyDude4(int theValue) {
void setMyDude4(int theValue)
{
myDude4 = theValue;
}
int getMyDude4() const {
int getMyDude4() const
{
return myDude4;
}
void setMyName(const std::string& theValue) {
void setMyName(const std::string& theValue)
{
myName = theValue;
}
std::string getMyName() const {
std::string getMyName() const
{
return myName;
}
void setMyAvatar(const std::string& theValue) {
void setMyAvatar(const std::string& theValue)
{
myAvatar = theValue;
}
std::string getMyAvatar() const {
std::string getMyAvatar() const
{
return myAvatar;
}
void setMyCash(int theValue) {
void setMyCash(int theValue)
{
myCash = theValue;
}
int getMyCash() const {
int getMyCash() const
{
return myCash;
}
void setMySet(int theValue) {
void setMySet(int theValue)
{
myLastRelativeSet = theValue;
mySet += theValue;
myCash -= theValue;
}
void setMySetAbsolute(int theValue) {
void setMySetAbsolute(int theValue)
{
mySet = theValue;
}
void setMySetNull() {
void setMySetNull()
{
mySet = 0;
myLastRelativeSet = 0;
}
int getMySet() const {
int getMySet() const
{
return mySet;
}
int getMyLastRelativeSet() const {
int getMyLastRelativeSet() const
{
return myLastRelativeSet;
}
void setMyAction(PlayerAction theValue, bool human = 0) {
void setMyAction(PlayerAction theValue, bool human = 0)
{
myAction = theValue;
// logging for seat 0
if(myAction && human) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, myLastRelativeSet);
}
PlayerAction getMyAction() const {
PlayerAction getMyAction() const
{
return myAction;
}
void setMyButton(int theValue) {
void setMyButton(int theValue)
{
myButton = theValue;
}
int getMyButton() const {
int getMyButton() const
{
return myButton;
}
void setMyActiveStatus(bool theValue) {
void setMyActiveStatus(bool theValue)
{
myActiveStatus = theValue;
}
bool getMyActiveStatus() const {
bool getMyActiveStatus() const
{
return myActiveStatus;
}
void setMyStayOnTableStatus(bool theValue) {
void setMyStayOnTableStatus(bool theValue)
{
myStayOnTableStatus = theValue;
}
bool getMyStayOnTableStatus() const {
bool getMyStayOnTableStatus() const
{
return myStayOnTableStatus;
}
void setMyCards(int* theValue) {
void setMyCards(int* theValue)
{
int i;
for(i=0; i<2; i++) myCards[i] = theValue[i];
}
void getMyCards(int* theValue) const {
void getMyCards(int* theValue) const
{
int i;
for(i=0; i<2; i++) theValue[i] = myCards[i];
}
void setMyTurn(bool theValue) {
void setMyTurn(bool theValue)
{
myTurn = theValue;
}
bool getMyTurn() const {
bool getMyTurn() const
{
return myTurn;
}
void setMyCardsFlip(bool theValue, int state) {
void setMyCardsFlip(bool theValue, int state)
{
myCardsFlip = theValue;
// log flipping cards
if(myCardsFlip) {
@@ -191,66 +225,81 @@ public:
}
}
}
bool getMyCardsFlip() const {
bool getMyCardsFlip() const
{
return myCardsFlip;
}
void setMyCardsValueInt(int theValue) {
void setMyCardsValueInt(int theValue)
{
myCardsValueInt = theValue;
}
int getMyCardsValueInt() const {
int getMyCardsValueInt() const
{
return myCardsValueInt;
}
void setLogHoleCardsDone(bool theValue) {
void setLogHoleCardsDone(bool theValue)
{
logHoleCardsDone = theValue;
}
bool getLogHoleCardsDone() const {
bool getLogHoleCardsDone() const
{
return logHoleCardsDone;
}
void setMyBestHandPosition(int* theValue) {
void setMyBestHandPosition(int* theValue)
{
for (int i = 0; i < 5; i++)
myBestHandPosition[i] = theValue[i];
}
void getMyBestHandPosition(int* theValue) const {
void getMyBestHandPosition(int* theValue) const
{
for (int i = 0; i < 5; i++)
theValue[i] = myBestHandPosition[i];
}
void setMyRoundStartCash(int theValue) {
void setMyRoundStartCash(int theValue)
{
myRoundStartCash = theValue;
}
int getMyRoundStartCash() const {
int getMyRoundStartCash() const
{
return myRoundStartCash;
}
void setLastMoneyWon ( int theValue ) {
void setLastMoneyWon ( int theValue )
{
lastMoneyWon = theValue;
}
int getLastMoneyWon() const {
int getLastMoneyWon() const
{
return lastMoneyWon;
}
void setMyAverageSets(int theValue) {
void setMyAverageSets(int theValue)
{
myAverageSets[0] = myAverageSets[1];
myAverageSets[1] = myAverageSets[2];
myAverageSets[2] = myAverageSets[3];
myAverageSets[3] = theValue;
}
int getMyAverageSets() const {
int getMyAverageSets() const
{
return (myAverageSets[0]+myAverageSets[1]+myAverageSets[2]+myAverageSets[3])/4;
}
void setMyAggressive(bool theValue) {
void setMyAggressive(bool theValue)
{
int i;
for(i=0; i<6; i++) {
myAggressive[i] = myAggressive[i+1];
}
myAggressive[6] = theValue;
}
int getMyAggressive() const {
int getMyAggressive() const
{
int i, sum = 0;
for(i=0; i<7; i++) {
sum += myAggressive[i];
@@ -258,17 +307,21 @@ public:
return sum;
}
void setSBluff ( int theValue ) {
void setSBluff ( int theValue )
{
sBluff = theValue;
}
int getSBluff() const {
int getSBluff() const
{
return sBluff;
}
void setSBluffStatus ( bool theValue ) {
void setSBluffStatus ( bool theValue )
{
sBluffStatus = theValue;
}
bool getSBluffStatus() const {
bool getSBluffStatus() const
{
return sBluffStatus;
}
+2 -1
View File
@@ -51,7 +51,8 @@ boost::thread_specific_ptr<boost::random_device> g_rand_state;
struct nondet_rng : std::unary_function<unsigned, unsigned> {
boost::random_device &_state;
unsigned operator()(unsigned i) {
unsigned operator()(unsigned i)
{
boost::uniform_int<> rng(0, i - 1);
return rng(_state);
}
+2 -1
View File
@@ -50,7 +50,8 @@ boost::thread_specific_ptr<boost::mt19937> g_rand_state;
struct det_rng : std::unary_function<unsigned, unsigned> {
boost::mt19937 &_state;
unsigned operator()(unsigned i) {
unsigned operator()(unsigned i)
{
boost::uniform_int<> rng(0, i - 1);
return rng(_state);
}
+4 -2
View File
@@ -66,11 +66,13 @@ public:
void logAfterGame();
// void closeLogDbAtExit();
void setCurrentRound(GameState theValue) {
void setCurrentRound(GameState theValue)
{
currentRound = theValue;
}
std::string getMySqliteLogFileName() {
std::string getMySqliteLogFileName()
{
return mySqliteLogFileName.directory_string();
}
+1 -1
View File
@@ -37,7 +37,7 @@
using namespace std;
ClientBoard::ClientBoard()
: pot(0), sets(0), allInCondition(false), lastActionPlayerID(0)
: pot(0), sets(0), allInCondition(false), lastActionPlayerID(0)
{
myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0;
}
+2 -2
View File
@@ -44,7 +44,7 @@ class HandInterface;
class ClientBoard : public BoardInterface
{
public:
ClientBoard();
ClientBoard();
~ClientBoard();
void setPlayerLists(PlayerList, PlayerList, PlayerList);
@@ -63,7 +63,7 @@ public:
void collectSets();
void collectPot();
void distributePot(unsigned);
void distributePot(unsigned);
void determinePlayerNeedToShowCards();
std::list<unsigned> getWinners() const;
@@ -57,7 +57,7 @@ ClientEngineFactory::createHand(boost::shared_ptr<EngineFactory> f, GuiInterface
boost::shared_ptr<BoardInterface>
ClientEngineFactory::createBoard()
{
return boost::shared_ptr<BoardInterface>(new ClientBoard());
return boost::shared_ptr<BoardInterface>(new ClientBoard());
}
boost::shared_ptr<PlayerInterface>
@@ -52,7 +52,7 @@ public:
~ClientEngineFactory();
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();
virtual boost::shared_ptr<BoardInterface> createBoard();
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);
};
+2 -1
View File
@@ -63,7 +63,8 @@ public:
GuiInterface* getGuiInterface() const;
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const;
Log* getLog() const {
Log* getLog() const
{
return myLog;
}
+2 -1
View File
@@ -156,7 +156,8 @@ public:
bool checkIfINeedToShowCards();
void markRemoteAction() {}
unsigned getTimeSecSinceLastRemoteAction() const {
unsigned getTimeSecSinceLastRemoteAction() const
{
return 0;
}