actual -> current ;)

This commit is contained in:
floty
2007-10-18 17:40:12 +00:00
parent ecb9f91a72
commit 06a8fd5730
21 changed files with 2222 additions and 2222 deletions
+2 -2
View File
@@ -59,8 +59,8 @@ public:
virtual void setStartQuantityPlayers(int theValue) =0;
virtual int getStartQuantityPlayers() const =0;
virtual void setActualRound(int theValue) =0;
virtual int getActualRound() const =0;
virtual void setCurrentRound(int theValue) =0;
virtual int getCurrentRound() const =0;
virtual void setDealerPosition(int theValue) =0;
virtual int getDealerPosition() const =0;
+2 -2
View File
@@ -274,7 +274,7 @@ void LocalBeRo::run() {
// aktuelle bero nicht dran, weil alle Sets gleich sind
//also gehe in naechste bero
myHand->setActualRound(myBeRoID+1);
myHand->setCurrentRound(myBeRoID+1);
//Action loeschen und ActionButtons refresh
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
@@ -322,7 +322,7 @@ void LocalBeRo::run() {
//// !!!!!!!!! attention: exception if player failed before !!!!!!!!
// if( !(myHand->getActualQuantityPlayers() < 3 && firstHeadsUpRound == 1) || myHand->getPlayerArray()[playersTurn]->getMyActiveStatus() == 0 ) {
// if( !(myHand->getCurrentQuantityPlayers() < 3 && firstHeadsUpRound == 1) || myHand->getPlayerArray()[playersTurn]->getMyActiveStatus() == 0 ) {
// not first round in heads up (for headsup dealer is smallblind so it is dealers turn)
// naechsten Spieler ermitteln
+2 -2
View File
@@ -306,10 +306,10 @@ void LocalBeRoPreflop::run() {
// Preflop nicht dran, weil wir nicht mehr in erster PreflopRunde und alle Sets gleich sind
//also gehe in Flop
getMyHand()->setActualRound(GAME_STATE_FLOP);
getMyHand()->setCurrentRound(GAME_STATE_FLOP);
// exception no.1 - see above
// if(getMyHand()->getAllInCondition()) getMyHand()->setActualRound(GAME_STATE_PREFLOP);;
// if(getMyHand()->getAllInCondition()) getMyHand()->setCurrentRound(GAME_STATE_PREFLOP);;
//Action loeschen und ActionButtons refresh
for(it_c=getMyHand()->getRunningPlayerList()->begin(); it_c!=getMyHand()->getRunningPlayerList()->end(); it_c++) {
+14 -14
View File
@@ -30,7 +30,7 @@
using namespace std;
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl_old, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(false),
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(false),
cardsShown(false), bettingRoundsPlayed(0)
{
@@ -551,7 +551,7 @@ void LocalHand::switchRounds() {
myBoard->collectPot();
myGui->refreshPot();
myGui->refreshSet();
actualRound = 4;
currentRound = 4;
}
// prfen der All In Kondition
// fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein
@@ -568,7 +568,7 @@ void LocalHand::switchRounds() {
// TODO -> runningPlayerList s.u.
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
//
// if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMySet() >= myBeRo[actualRound]->getHighestSet()) {
// if(playerArray[i]->getMyAction() != 1 && playerArray[i]->getMyAction() != 6 && playerArray[i]->getMyActiveStatus() == 1 && playerArray[i]->getMySet() >= myBeRo[currentRound]->getHighestSet()) {
// allInCondition = 1;
// }
//
@@ -577,13 +577,13 @@ void LocalHand::switchRounds() {
for(it_c=runningPlayerList->begin(); it_c!=runningPlayerList->end(); it_c++) {
if((*it_c)->getMySet() >= myBeRo[actualRound]->getHighestSet()) {
if((*it_c)->getMySet() >= myBeRo[currentRound]->getHighestSet()) {
allInCondition = true;
}
}
// if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[actualRound]->getHighestSet() ) {
// if( (*(runningPlayerList.begin()))->getMySet() >= myBeRo[currentRound]->getHighestSet() ) {
// allInCondition = 1;
// }
@@ -600,9 +600,9 @@ void LocalHand::switchRounds() {
// exception
// no.1: if in first Preflop Round next player is small blind and only all-in-big-blind with less than smallblind amount and other all-in players with less than small blind are nonfold too -> preflop is over
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[actualRound]->getSmallBlindPositionId());
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[actualRound]->getBigBlindPositionId());
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && actualRound == GAME_STATE_PREFLOP && myBeRo[actualRound]->getFirstRound()) {
PlayerListConstIterator smallBlindIt_c = getRunningPlayerIt(myBeRo[currentRound]->getSmallBlindPositionId());
PlayerListConstIterator bigBlindIt_c = getActivePlayerIt(myBeRo[currentRound]->getBigBlindPositionId());
if(smallBlindIt_c!=runningPlayerList->end() && bigBlindIt_c!=activePlayerList->end() && currentRound == GAME_STATE_PREFLOP && myBeRo[currentRound]->getFirstRound()) {
// determine player who are all in with less than small blind amount
int tempCounter = 0;
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) {
@@ -637,15 +637,15 @@ void LocalHand::switchRounds() {
myGui->refreshSet();
myGui->flipHolecardsAllIn();
if (actualRound < 4) // do not increment past 4
actualRound++;
if (currentRound < 4) // do not increment past 4
currentRound++;
//log board cards for allin
if(actualRound >= 1) {
if(currentRound >= 1) {
int tempBoardCardsArray[5];
myBoard->getMyCards(tempBoardCardsArray);
myGui->logDealBoardCardsMsg(actualRound, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]);
myGui->logDealBoardCardsMsg(currentRound, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]);
}
}
@@ -664,13 +664,13 @@ void LocalHand::switchRounds() {
}
myGui->refreshGameLabels((GameState)getActualRound());
myGui->refreshGameLabels((GameState)getCurrentRound());
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
//
// cout << "NextPlayerSpeed2 start" << endl;
switch(actualRound) {
switch(currentRound) {
case 0: {
// Preflop starten
myGui->preflopAnimation1();
+4 -4
View File
@@ -54,7 +54,7 @@ public:
boost::shared_ptr<BeRoInterface> getTurn() const { return myBeRo[GAME_STATE_TURN]; }
boost::shared_ptr<BeRoInterface> getRiver() const { return myBeRo[GAME_STATE_RIVER]; }
GuiInterface* getGuiInterface() const { return myGui; }
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const { return myBeRo[actualRound]; }
boost::shared_ptr<BeRoInterface> getCurrentBeRo() const { return myBeRo[currentRound]; }
void setMyID(int theValue) { myID = theValue; }
int getMyID() const { return myID; }
@@ -62,8 +62,8 @@ public:
void setStartQuantityPlayers(int theValue) { startQuantityPlayers = theValue; }
int getStartQuantityPlayers() const { return startQuantityPlayers; }
void setActualRound(int theValue) { actualRound = theValue; }
int getActualRound() const { return actualRound; }
void setCurrentRound(int theValue) { currentRound = theValue; }
int getCurrentRound() const { return currentRound; }
void setDealerPosition(int theValue) { dealerPosition = theValue; }
int getDealerPosition() const { return dealerPosition; }
@@ -107,7 +107,7 @@ private:
int myID;
int startQuantityPlayers;
unsigned dealerPosition; // -1 -> neutral
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
int smallBlind;
int startCash;
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -67,7 +67,7 @@ public:
void setMyAction(int theValue, bool blind = 0) {
myAction = theValue;
// logging for human player
if(myAction && !blind) actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
if(myAction && !blind) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
}
int getMyAction() const { return myAction; }
@@ -88,11 +88,11 @@ public:
// log flipping cards
if(myCardsFlip) {
switch(state) {
case 1: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
case 1: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
break;
case 2: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
case 2: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
break;
case 3: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
case 3: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
break;
default: ;
}
@@ -143,7 +143,7 @@ public:
void setMyWinnerState ( bool theValue, int pot ) {
if(theValue) myWinnerState = theValue;
actualHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
currentHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
}
bool getMyWinnerState() const { return myWinnerState;}
@@ -179,8 +179,8 @@ public:
private:
ConfigFile *myConfig;
HandInterface *actualHand;
BoardInterface *actualBoard;
HandInterface *currentHand;
BoardInterface *currentBoard;
CardsValue *myCardsValue;
+2 -2
View File
@@ -24,7 +24,7 @@
using namespace std;
ClientBoard::ClientBoard()
: playerArray(0), actualHand(0), pot(0), sets(0)
: playerArray(0), currentHand(0), pot(0), sets(0)
{
}
@@ -47,7 +47,7 @@ void
ClientBoard::setHand(HandInterface* br)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
actualHand = br;
currentHand = br;
}
void
+1 -1
View File
@@ -60,7 +60,7 @@ private:
PlayerList activePlayerList;
PlayerList runningPlayerList;
HandInterface *actualHand;
HandInterface *currentHand;
std::list<int> winners;
+6 -6
View File
@@ -22,7 +22,7 @@
using namespace std;
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, std::vector<boost::shared_ptr<PlayerInterface> > sl_old, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), actualRound(0),
: myFactory(f), myGui(g), myBoard(b), playerArray(sl_old), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0),
smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(0),
cardsShown(false), bettingRoundsPlayed(0)
{
@@ -166,7 +166,7 @@ ClientHand::getRiver() const
boost::shared_ptr<BeRoInterface>
ClientHand::getCurrentBeRo() const
{
return myBeRo[actualRound];
return myBeRo[currentRound];
}
@@ -205,17 +205,17 @@ ClientHand::getStartQuantityPlayers() const
}
void
ClientHand::setActualRound(int theValue)
ClientHand::setCurrentRound(int theValue)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
actualRound = theValue;
currentRound = theValue;
}
int
ClientHand::getActualRound() const
ClientHand::getCurrentRound() const
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return actualRound;
return currentRound;
}
void
+6 -6
View File
@@ -57,14 +57,14 @@ class ClientHand : public HandInterface
void setMyID ( int theValue );
int getMyID() const;
void setActualQuantityPlayers ( int theValue );
int getActualQuantityPlayers() const;
void setCurrentQuantityPlayers ( int theValue );
int getCurrentQuantityPlayers() const;
void setStartQuantityPlayers ( int theValue );
int getStartQuantityPlayers() const;
void setActualRound ( int theValue );
int getActualRound() const;
void setCurrentRound ( int theValue );
int getCurrentRound() const;
void setDealerPosition ( int theValue );
int getDealerPosition() const;
@@ -106,8 +106,8 @@ class ClientHand : public HandInterface
int myID;
int startQuantityPlayers;
int dealerPosition; // -1 -> neutral
int actualRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
unsigned dealerPosition;
int currentRound; //0 = preflop, 1 = flop, 2 = turn, 3 = river
int smallBlind;
int startCash;
+6 -6
View File
@@ -23,7 +23,7 @@ using namespace std;
ClientPlayer::ClientPlayer(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), actualHand(0), actualBoard(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), sBluff(0), sBluffStatus(0)
{
}
@@ -37,7 +37,7 @@ void
ClientPlayer::setHand(HandInterface* br)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
actualHand = br;
currentHand = br;
}
int
@@ -244,11 +244,11 @@ ClientPlayer::setMyCardsFlip(bool theValue, int state)
// log flipping cards
if (myCardsFlip) {
switch(state) {
case 1: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
case 1: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt);
break;
case 2: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
case 2: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1]);
break;
case 3: actualHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
case 3: currentHand->getGuiInterface()->logFlipHoleCardsMsg(myName, myCards[0], myCards[1], myCardsValueInt, "has");
break;
default: ;
}
@@ -379,7 +379,7 @@ ClientPlayer::setMyWinnerState(bool theValue, int pot)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
if(theValue) myWinnerState = theValue;
actualHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
currentHand->getGuiInterface()->logPlayerWinsMsg(myName, pot, theValue);
}
bool
+2 -2
View File
@@ -132,8 +132,8 @@ private:
mutable boost::recursive_mutex m_syncMutex;
ConfigFile *myConfig;
HandInterface *actualHand;
BoardInterface *actualBoard;
HandInterface *currentHand;
BoardInterface *currentBoard;
CardsValue *myCardsValue;
+31 -31
View File
@@ -33,10 +33,10 @@ using namespace std;
Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
const PlayerDataList &playerDataList, const GameData &gameData,
const StartData &startData, int gameId)
: myFactory(factory), myGui(gui), actualHand(0), actualBoard(0),
: myFactory(factory), myGui(gui), currentHand(0), currentBoard(0),
startQuantityPlayers(startData.numberOfPlayers),
startCash(gameData.startMoney), startSmallBlind(gameData.firstSmallBlind),
myGameID(gameId), actualSmallBlind(gameData.firstSmallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
myGameID(gameId), currentSmallBlind(gameData.firstSmallBlind), currentHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
{
blindsList = myGameData.manualBlindsList;
@@ -44,13 +44,13 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
if(DEBUG_MODE) {
startSmallBlind = 10;
actualSmallBlind = startSmallBlind;
currentSmallBlind = startSmallBlind;
}
// cout << "Create Game Object" << "\n";
int i;
actualHandID = 0;
currentHandID = 0;
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
// playerArray[i] = 0;
@@ -71,7 +71,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
dealerPosition = startData.startDealerPlayerId;
// Board erstellen
actualBoard = myFactory->createBoard();
currentBoard = myFactory->createBoard();
seatsList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
activePlayerList = PlayerList(new std::list<boost::shared_ptr<PlayerInterface> >);
@@ -101,7 +101,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
}
// create Player Objects
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(actualBoard, i, uniqueId, type, myName, myAvatarFile, startCash, startQuantityPlayers > i, 0);
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(currentBoard, i, uniqueId, type, myName, myAvatarFile, startCash, startQuantityPlayers > i, 0);
tmpPlayer->setNetSessionData(myNetSession);
@@ -117,7 +117,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
playerArray[i]->setNetSessionData(myNetSession); // delete
}
actualBoard->setPlayerLists(playerArray, seatsList, activePlayerList, runningPlayerList); // delete playerArray
currentBoard->setPlayerLists(playerArray, seatsList, activePlayerList, runningPlayerList); // delete playerArray
//start timer
blindsTimer.reset();
@@ -128,21 +128,21 @@ Game::~Game()
{
// cout << "Delete Game Object" << "\n";
delete actualBoard;
actualBoard = 0;
delete actualHand;
actualHand = 0;
delete currentBoard;
currentBoard = 0;
delete currentHand;
currentHand = 0;
}
HandInterface *Game::getCurrentHand()
{
return actualHand;
return currentHand;
}
const HandInterface *Game::getCurrentHand() const
{
return actualHand;
return currentHand;
}
void Game::initHand()
@@ -152,7 +152,7 @@ void Game::initHand()
PlayerListConstIterator it_c;
PlayerListIterator it, it_2;
actualHandID++;
currentHandID++;
// calculate smallBlind
raiseBlinds();
@@ -182,16 +182,16 @@ void Game::initHand()
}
// eventuell vorhandene Hand löschen
if(actualHand) {
delete actualHand;
actualHand = 0;
if(currentHand) {
delete currentHand;
currentHand = 0;
}
runningPlayerList->clear();
(*runningPlayerList) = (*activePlayerList);
// Hand erstellen
actualHand = myFactory->createHand(myFactory, myGui, actualBoard, playerArray, seatsList, activePlayerList, runningPlayerList, actualHandID, startQuantityPlayers, dealerPosition, actualSmallBlind, startCash); // delete playerArray
currentHand = myFactory->createHand(myFactory, myGui, currentBoard, playerArray, seatsList, activePlayerList, runningPlayerList, currentHandID, startQuantityPlayers, dealerPosition, currentSmallBlind, startCash); // delete playerArray
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!! DELETE
@@ -202,7 +202,7 @@ void Game::initHand()
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!!
bool nextDealerFound = false;
PlayerListConstIterator dealerPositionIt = actualHand->getSeatIt(dealerPosition);
PlayerListConstIterator dealerPositionIt = currentHand->getSeatIt(dealerPosition);
if(dealerPositionIt == seatsList->end()) {
throw LocalException(ERR_SEAT_NOT_FOUND);
}
@@ -212,7 +212,7 @@ void Game::initHand()
dealerPositionIt++;
if(dealerPositionIt == seatsList->end()) dealerPositionIt = seatsList->begin();
it = actualHand->getActivePlayerIt( (*dealerPositionIt)->getMyUniqueID() );
it = currentHand->getActivePlayerIt( (*dealerPositionIt)->getMyUniqueID() );
if(it != activePlayerList->end() ) {
nextDealerFound = true;
dealerPosition = (*it)->getMyUniqueID();
@@ -233,10 +233,10 @@ void Game::startHand()
myGui->nextRoundCleanGui();
//Log new Hand
myGui->logNewGameHandMsg(myGameID, actualHandID);
myGui->logNewGameHandMsg(myGameID, currentHandID);
myGui->flushLogAtGame(myGameID);
actualHand->start();
currentHand->start();
}
boost::shared_ptr<PlayerInterface> Game::getPlayerByUniqueId(unsigned id)
@@ -275,9 +275,9 @@ void Game::raiseBlinds() {
if (myGameData.raiseIntervalMode == RAISE_ON_HANDNUMBER) {
if (lastHandBlindsRaised + myGameData.raiseSmallBlindEveryHandsValue <= actualHandID) {
if (lastHandBlindsRaised + myGameData.raiseSmallBlindEveryHandsValue <= currentHandID) {
raiseBlinds = true;
lastHandBlindsRaised = actualHandID;
lastHandBlindsRaised = currentHandID;
// cout << "raise now on hands \n";
}
@@ -297,7 +297,7 @@ void Game::raiseBlinds() {
// Now we check how the blinds should be raised
if (myGameData.raiseMode == DOUBLE_BLINDS) {
actualSmallBlind *= 2;
currentSmallBlind *= 2;
// cout << "double small blind \n";
}
else {
@@ -307,17 +307,17 @@ void Game::raiseBlinds() {
if(!blindsList.empty()) {
actualSmallBlind = blindsList.front();
currentSmallBlind = blindsList.front();
blindsList.pop_front();
// it = find(blindsList.begin(), blindsList.end(), actualSmallBlind);
// it = find(blindsList.begin(), blindsList.end(), currentSmallBlind);
// if(it != blindsList.end()) {
// it++;
// cout << "increase position in blindslist \n";
// }
// else {
// cout << "blindslist exceeds\n";
// if(actualSmallBlind == myGameData.firstSmallBlind) {
// if(currentSmallBlind == myGameData.firstSmallBlind) {
// it = blindsList.begin();
// }
// }
@@ -330,19 +330,19 @@ void Game::raiseBlinds() {
// The position exceeds the list
if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) {
actualSmallBlind *= 2;
currentSmallBlind *= 2;
// cout << "after blindslist double blind\n";
}
else {
if(myGameData.afterManualBlindsMode == AFTERMB_RAISE_ABOUT) {
actualSmallBlind += myGameData.afterMBAlwaysRaiseValue;
currentSmallBlind += myGameData.afterMBAlwaysRaiseValue;
// cout << "after blindslist increase about x \n";
}
// else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; }
}
// } else {
// Grab the blinds amount from the list
// actualSmallBlind = *it;
// currentSmallBlind = *it;
// cout << "set new small blind from blindslist \n";
}
}
+8 -8
View File
@@ -73,11 +73,11 @@ public:
int getMyGameID() const { return myGameID; }
void setActualSmallBlind(int theValue) { actualSmallBlind = theValue; }
int getActualSmallBlind() const { return actualSmallBlind; }
void setCurrentSmallBlind(int theValue) { currentSmallBlind = theValue; }
int getCurrentSmallBlind() const { return currentSmallBlind; }
void setActualHandID(int theValue) { actualHandID = theValue; }
int getActualHandID() const { return actualHandID; }
void setCurrentHandID(int theValue) { currentHandID = theValue; }
int getCurrentHandID() const { return currentHandID; }
boost::shared_ptr<PlayerInterface> getPlayerByUniqueId(unsigned id);
boost::shared_ptr<PlayerInterface> getCurrentPlayer();
@@ -88,8 +88,8 @@ private:
boost::shared_ptr<EngineFactory> myFactory;
GuiInterface *myGui;
HandInterface *actualHand;
BoardInterface *actualBoard;
HandInterface *currentHand;
BoardInterface *currentBoard;
std::vector<boost::shared_ptr<PlayerInterface> > playerArray; // available seats --> seatList !!! TODO // delete
PlayerList seatsList;
@@ -106,8 +106,8 @@ private:
int guiPlayerNum;
//Laufvariablen
int actualSmallBlind;
int actualHandID;
int currentSmallBlind;
int currentHandID;
unsigned dealerPosition;
int lastHandBlindsRaised;
int lastTimeBlindsRaised;
+7 -7
View File
@@ -59,7 +59,7 @@
using namespace std;
mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
: QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterActualHand(FALSE)
: QMainWindow(parent), myChat(NULL), myConfig(c), gameSpeed(0), myActionIsBet(0), myActionIsRaise(0), pushButtonBetRaiseIsChecked(FALSE), pushButtonCallCheckIsChecked(FALSE), pushButtonFoldIsChecked(FALSE), pushButtonAllInIsChecked(FALSE), myButtonsAreCheckable(FALSE), breakAfterCurrentHand(FALSE)
{
int i;
@@ -2120,7 +2120,7 @@ void mainWindowImpl::provideMyActions() {
horizontalSlider_bet->setEnabled(TRUE);
spinBox_set->setEnabled(TRUE);
switch (currentHand->getActualRound()) {
switch (currentHand->getCurrentRound()) {
case 0: {
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
@@ -3432,7 +3432,7 @@ void mainWindowImpl::showMyCards() {
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
currentHand->getSeatsList()->front()->getMyCards(tempCardsIntArray);
if( currentHand->getSeatsList()->front()->getMyCardsFlip() == 0 && currentHand->getActualRound() == 4 && currentHand->getSeatsList()->front()->getMyActiveStatus() && currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD) {
if( currentHand->getSeatsList()->front()->getMyCardsFlip() == 0 && currentHand->getCurrentRound() == 4 && currentHand->getSeatsList()->front()->getMyActiveStatus() && currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD) {
//set Player value (logging)
currentHand->getSeatsList()->front()->setMyCardsFlip(1,1);
@@ -3442,7 +3442,7 @@ void mainWindowImpl::showMyCards() {
void mainWindowImpl::startNewHand() {
if( !breakAfterActualHand){
if( !breakAfterCurrentHand){
mySession->getCurrentGame()->initHand();
mySession->getCurrentGame()->startHand();
}
@@ -3454,7 +3454,7 @@ void mainWindowImpl::startNewHand() {
pushButton_break->setMinimumSize(width+10,20);
pushButton_break->setText(tr("Start"));
breakAfterActualHand=FALSE;
breakAfterCurrentHand=FALSE;
blinkingStartButtonAnimationTimer->start(500);
}
@@ -3508,7 +3508,7 @@ void mainWindowImpl::nextRoundCleanGui() {
else {
//FIX STRG+N Bug
pushButton_break->setEnabled(TRUE);
breakAfterActualHand=FALSE;
breakAfterCurrentHand=FALSE;
}
//Clean breakbutton
@@ -3582,7 +3582,7 @@ void mainWindowImpl::breakButtonClicked() {
if (pushButton_break->text() == tr("Stop")) {
pushButton_break->setDisabled(TRUE);
breakAfterActualHand=TRUE;
breakAfterCurrentHand=TRUE;
}
else {
blinkingStartButtonAnimationTimer->stop();
+1 -1
View File
@@ -454,7 +454,7 @@ private:
bool pushButtonAllInIsChecked;
bool myButtonsAreCheckable;
bool breakAfterActualHand;
bool breakAfterCurrentHand;
bool flipHolecardsAllInAlreadyDone;
+2 -2
View File
@@ -967,10 +967,10 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
throw ClientException(ERR_NET_UNKNOWN_PLAYER_ID, 0);
// Set round.
if (curGame->getCurrentHand()->getActualRound() != turnData.gameState)
if (curGame->getCurrentHand()->getCurrentRound() != turnData.gameState)
{
ResetPlayerActions(*curGame);
curGame->getCurrentHand()->setActualRound(turnData.gameState);
curGame->getCurrentHand()->setCurrentRound(turnData.gameState);
// Refresh actions.
client.GetGui().refreshSet();
client.GetGui().refreshAction();
+1 -1
View File
@@ -135,7 +135,7 @@ ClientThread::SendPlayerAction()
boost::shared_ptr<NetPacket> action(new NetPacketPlayersAction);
NetPacketPlayersAction::Data actionData;
boost::shared_ptr<PlayerInterface> myPlayer = GetGame()->getSeatsList()->front();
actionData.gameState = static_cast<GameState>(GetGame()->getCurrentHand()->getActualRound());
actionData.gameState = static_cast<GameState>(GetGame()->getCurrentHand()->getCurrentRound());
actionData.playerAction = static_cast<PlayerAction>(myPlayer->getMyAction());
// Only send last bet if not fold/checked.
if (actionData.playerAction != PLAYER_ACTION_FOLD && actionData.playerAction != PLAYER_ACTION_CHECK)
+6 -6
View File
@@ -622,11 +622,11 @@ ServerGameStateStartRound::Process(ServerGameThread &server)
Game &curGame = server.GetGame();
// Main game loop.
int curRound = curGame.getCurrentHand()->getActualRound();
int curRound = curGame.getCurrentHand()->getCurrentRound();
curGame.getCurrentHand()->switchRounds();
if (!curGame.getCurrentHand()->getAllInCondition())
curGame.getCurrentHand()->getCurrentBeRo()->run();
int newRound = curGame.getCurrentHand()->getActualRound();
int newRound = curGame.getCurrentHand()->getCurrentRound();
// If round changes, deal cards if needed.
if (newRound != curRound && newRound != GAME_STATE_POST_RIVER)
@@ -690,7 +690,7 @@ ServerGameStateStartRound::Process(ServerGameThread &server)
boost::shared_ptr<NetPacket> notification(new NetPacketPlayersTurn);
NetPacketPlayersTurn::Data playersTurnData;
playersTurnData.gameState = (GameState)curGame.getCurrentHand()->getActualRound();
playersTurnData.gameState = (GameState)curGame.getCurrentHand()->getCurrentRound();
playersTurnData.playerId = curPlayer->getMyUniqueID();
playersTurnData.minimumRaise = curGame.getCurrentHand()->getCurrentBeRo()->getMinimumRaise();
static_cast<NetPacketPlayersTurn *>(notification.get())->SetData(playersTurnData);
@@ -866,7 +866,7 @@ ServerGameStateWaitPlayerAction::InternalProcess(ServerGameThread &server, Sessi
// Check whether this is the correct round.
PlayerActionCode code = ACTION_CODE_VALID;
if (curGame.getCurrentHand()->getActualRound() != actionData.gameState)
if (curGame.getCurrentHand()->getCurrentRound() != actionData.gameState)
code = ACTION_CODE_INVALID_STATE;
// Check whether this is the correct player.
@@ -1029,7 +1029,7 @@ ServerGameStateDealCardsDelay::Process(ServerGameThread &server)
int allInDelay = curGame.getCurrentHand()->getAllInCondition() ? SERVER_DEAL_ADD_ALL_IN_DELAY_SEC : 0;
int delay = 0;
switch(curGame.getCurrentHand()->getActualRound())
switch(curGame.getCurrentHand()->getCurrentRound())
{
case GAME_STATE_FLOP:
delay = SERVER_DEAL_FLOP_CARDS_DELAY_SEC;
@@ -1082,7 +1082,7 @@ ServerGameStateShowCardsDelay::Process(ServerGameThread &server)
if (GetTimer().elapsed().total_seconds() >= SERVER_SHOW_CARDS_DELAY_SEC)
{
Game &curGame = server.GetGame();
SendNewRoundCards(server, curGame, curGame.getCurrentHand()->getActualRound());
SendNewRoundCards(server, curGame, curGame.getCurrentHand()->getCurrentRound());
server.SetState(ServerGameStateDealCardsDelay::Instance());
retVal = MSG_NET_GAME_SERVER_CARDS_DELAY;
+1 -1
View File
@@ -94,7 +94,7 @@ ServerGameThread::AddSession(SessionWrapper session)
GameState
ServerGameThread::GetCurRound() const
{
return static_cast<GameState>(GetGame().getCurrentHand()->getActualRound());
return static_cast<GameState>(GetGame().getCurrentHand()->getCurrentRound());
}
void