run astyle

This commit is contained in:
floty
2014-03-16 21:46:52 +01:00
parent 2a78c06d03
commit b93525607e
14 changed files with 40 additions and 41 deletions
+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();
+2 -2
View File
@@ -81,7 +81,7 @@ protected:
return myHand;
}
unsigned getDealerPosition() const {
unsigned getDealerPosition() const {
return dealerPosition;
}
@@ -171,7 +171,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);
+24 -24
View File
@@ -145,7 +145,7 @@ void LocalBoard::distributePot(unsigned dealerPosition)
// determine the number of level winners
winnerCount = potLevel.size()-2;
if (!winnerCount) {
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: no winner found");
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: no winner found");
}
// check if this is the final pot level for at least one winner
@@ -161,7 +161,7 @@ void LocalBoard::distributePot(unsigned dealerPosition)
if(finalPot) break;
}
if(finalPot && winnerCount>0) {
if(finalPot && winnerCount>0) {
// distribute the pot level sum to level winners
mod = (potLevel[1])%winnerCount;
// pot level sum divisible by winnerCount
@@ -175,13 +175,13 @@ void LocalBoard::distributePot(unsigned dealerPosition)
}
}
if(it == seatsList->end()) {
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: seat not found");
} else {
(*it)->setMyCash( (*it)->getMyCash() + ((potLevel[1])/winnerCount));
// filling winners vector
winners.push_back((*it)->getMyUniqueID());
(*it)->setLastMoneyWon( (*it)->getLastMoneyWon() + (potLevel[1])/winnerCount );
}
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: seat not found");
} else {
(*it)->setMyCash( (*it)->getMyCash() + ((potLevel[1])/winnerCount));
// filling winners vector
winners.push_back((*it)->getMyUniqueID());
(*it)->setLastMoneyWon( (*it)->getLastMoneyWon() + (potLevel[1])/winnerCount );
}
}
}
@@ -196,8 +196,8 @@ void LocalBoard::distributePot(unsigned dealerPosition)
}
}
if(it == seatsList->end()) {
it = seatsList->begin();
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: dealer position not found");
it = seatsList->begin();
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): distributePot-ERROR: dealer position not found");
}
for(j=0; j<winnerCount; j++) {
@@ -217,19 +217,19 @@ void LocalBoard::distributePot(unsigned dealerPosition)
}
if(winnerHit) {
if(j<mod) {
(*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 );
}
}
if(winnerHit) {
if(j<mod) {
(*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 );
}
}
}
}
potCarryOver = 0;
+2 -2
View File
@@ -45,7 +45,7 @@ class HandInterface;
class LocalBoard : public BoardInterface
{
public:
LocalBoard();
LocalBoard();
~LocalBoard();
void setPlayerLists(PlayerList, PlayerList, PlayerList);
@@ -82,7 +82,7 @@ public:
void collectSets() ;
void collectPot() ;
void distributePot(unsigned dealerPosition);
void distributePot(unsigned dealerPosition);
void determinePlayerNeedToShowCards();
std::list<unsigned> getWinners() const {
@@ -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);