- updating sqlite-log

- handID in bero is unnecessary; removing parameter value
This commit is contained in:
floty
2011-10-21 00:16:43 +00:00
parent d14d1b4787
commit 8ae7db3e96
28 changed files with 158 additions and 164 deletions
+2 -2
View File
@@ -24,8 +24,8 @@
using namespace std;
LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), 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)
LocalBeRo::LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), 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();
+1 -2
View File
@@ -28,7 +28,7 @@
class LocalBeRo : public BeRoInterface
{
public:
LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS);
LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
~LocalBeRo();
GameState getMyBeRoID() const {
@@ -169,7 +169,6 @@ private:
HandInterface* myHand;
const GameState myBeRoID;
int myID;
int dealerPosition;
int smallBlindPosition;
+1 -1
View File
@@ -23,7 +23,7 @@
using namespace std;
LocalBeRoFlop::LocalBeRoFlop(HandInterface* hi, int id, unsigned dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_FLOP)
LocalBeRoFlop::LocalBeRoFlop(HandInterface* hi, unsigned dP, int sB) : LocalBeRo(hi, dP, sB, GAME_STATE_FLOP)
{
}
+1 -1
View File
@@ -28,7 +28,7 @@ class LocalBeRoFlop : public LocalBeRo
{
public:
LocalBeRoFlop(HandInterface*, int, unsigned, int);
LocalBeRoFlop(HandInterface*, unsigned, int);
~LocalBeRoFlop();
};
+10 -1
View File
@@ -24,7 +24,7 @@
using namespace std;
LocalBeRoPostRiver::LocalBeRoPostRiver(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_POST_RIVER), highestCardsValue(0)
LocalBeRoPostRiver::LocalBeRoPostRiver(HandInterface* hi, int dP, int sB) : LocalBeRo(hi, dP, sB, GAME_STATE_POST_RIVER), highestCardsValue(0)
{
}
@@ -83,6 +83,15 @@ void LocalBeRoPostRiver::postRiverRun()
//Pot auf 0 setzen
getMyHand()->getBoard()->setPot(0);
// Logging hole Cards / Hands
int myCards[2];
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
(*it_c)->getMyCards(myCards);
getMyHand()->getLog()->logHoleCardsHandName((*it_c)->getMyID()+1,myCards,(*it_c)->getMyCardsValueInt(),getMyHand()->getActivePlayerList());
}
}
//starte die Animaionsreihe
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
}
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoPostRiver : public LocalBeRo
{
public:
LocalBeRoPostRiver(HandInterface*, int, int, int);
LocalBeRoPostRiver(HandInterface*, int, int);
~LocalBeRoPostRiver();
void setHighestCardsValue(int theValue) {
+1 -1
View File
@@ -26,7 +26,7 @@
using namespace std;
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, unsigned dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_PREFLOP)
LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, unsigned dP, int sB) : LocalBeRo(hi, dP, sB, GAME_STATE_PREFLOP)
{
setHighestSet(2*getSmallBlind());
}
+1 -1
View File
@@ -28,7 +28,7 @@ class LocalBeRoPreflop : public LocalBeRo
{
public:
LocalBeRoPreflop(HandInterface*, int, unsigned, int);
LocalBeRoPreflop(HandInterface*, unsigned, int);
~LocalBeRoPreflop();
void run();
+1 -1
View File
@@ -24,7 +24,7 @@
using namespace std;
LocalBeRoRiver::LocalBeRoRiver(HandInterface* hi, int id, unsigned dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_RIVER)
LocalBeRoRiver::LocalBeRoRiver(HandInterface* hi, unsigned dP, int sB) : LocalBeRo(hi, dP, sB, GAME_STATE_RIVER)
{
}
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoRiver : public LocalBeRo
{
public:
LocalBeRoRiver(HandInterface*, int, unsigned, int);
LocalBeRoRiver(HandInterface*, unsigned, int);
~LocalBeRoRiver();
};
+1 -1
View File
@@ -23,7 +23,7 @@
using namespace std;
LocalBeRoTurn::LocalBeRoTurn(HandInterface* hi, int id, unsigned dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_TURN)
LocalBeRoTurn::LocalBeRoTurn(HandInterface* hi, unsigned dP, int sB) : LocalBeRo(hi, dP, sB, GAME_STATE_TURN)
{
}
+1 -1
View File
@@ -27,7 +27,7 @@ class HandInterface;
class LocalBeRoTurn : public LocalBeRo
{
public:
LocalBeRoTurn(HandInterface*, int, unsigned, int);
LocalBeRoTurn(HandInterface*, unsigned, int);
~LocalBeRoTurn();
};
@@ -60,19 +60,19 @@ LocalEngineFactory::createPlayer(int id, unsigned uniqueId, PlayerType type, std
}
std::vector<boost::shared_ptr<BeRoInterface> >
LocalEngineFactory::createBeRo(HandInterface *hi, int id, unsigned dP, int sB)
LocalEngineFactory::createBeRo(HandInterface *hi, unsigned dP, int sB)
{
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, id, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, dP, sB)));
return myBeRo;
+1 -1
View File
@@ -39,7 +39,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<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 std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, int id, unsigned dP, int sB);
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
private:
ConfigFile *myConfig;
+9 -1
View File
@@ -367,7 +367,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
setBlinds();
myBeRo = myFactory->createBeRo(this, myID, dealerPosition, smallBlind);
myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind);
}
@@ -626,6 +626,14 @@ void LocalHand::switchRounds()
myGui->refreshPot();
myGui->refreshSet();
myGui->flipHolecardsAllIn();
// Logging HoleCards
int myCards[2];
for (it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
(*it_c)->getMyCards(myCards);
myLog->logHoleCards(currentRound+1,(*it_c)->getMyID()+1,myCards);
}
}
if (currentRound < 4) // do not increment past 4
currentRound++;
+3 -3
View File
@@ -166,15 +166,15 @@ public:
switch(state) {
case 1:
currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
currentHand->getLog()->logHoleCardsHandName(myID+1,myCards,myCardsValueInt,currentHand->getActivePlayerList());
// currentHand->getLog()->logHoleCardsHandName(myID+1,myCards,myCardsValueInt,currentHand->getActivePlayerList());
break;
case 2:
currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
currentHand->getLog()->logHoleCards(currentHand->getCurrentRound()+1,myID+1,myCards);
// currentHand->getLog()->logHoleCards(currentHand->getCurrentRound()+1,myID+1,myCards);
break;
case 3:
currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
currentHand->getLog()->logHandName(myID+1,myCardsValueInt,currentHand->getActivePlayerList());
// currentHand->getLog()->logHandName(myID+1,myCardsValueInt,currentHand->getActivePlayerList());
break;
default:
;