implementing manualBlindsList
This commit is contained in:
+24
-14
@@ -36,6 +36,10 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
startHandsBeforeRaiseSmallBlind(gameData.handsBeforeRaise),
|
startHandsBeforeRaiseSmallBlind(gameData.handsBeforeRaise),
|
||||||
myGameID(gameId), actualSmallBlind(gameData.smallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
|
myGameID(gameId), actualSmallBlind(gameData.smallBlind), actualHandID(0), dealerPosition(0), lastHandBlindsRaised(1), lastTimeBlindsRaised(0), myGameData(gameData)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
blindsList = myGameData.manualBlindsList;
|
||||||
|
|
||||||
|
|
||||||
if(DEBUG_MODE) {
|
if(DEBUG_MODE) {
|
||||||
startSmallBlind = 10;
|
startSmallBlind = 10;
|
||||||
actualSmallBlind = startSmallBlind;
|
actualSmallBlind = startSmallBlind;
|
||||||
@@ -308,25 +312,31 @@ void Game::raiseBlinds() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Increase the position of the list
|
// Increase the position of the list
|
||||||
list<int> blindsList = myGameData.manualBlindsList;
|
/* list<int> blindsList = myGameData.manualBlindsList;*/
|
||||||
list<int>::iterator it;
|
// list<int>::iterator it;
|
||||||
|
|
||||||
if(!blindsList.empty()) {
|
if(!blindsList.empty()) {
|
||||||
it = find(blindsList.begin(), blindsList.end(), actualSmallBlind);
|
|
||||||
if(it != blindsList.end()) {
|
actualSmallBlind = blindsList.front();
|
||||||
it++;
|
blindsList.pop_front();
|
||||||
|
|
||||||
|
// it = find(blindsList.begin(), blindsList.end(), actualSmallBlind);
|
||||||
|
// if(it != blindsList.end()) {
|
||||||
|
// it++;
|
||||||
// cout << "increase position in blindslist \n";
|
// cout << "increase position in blindslist \n";
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
// cout << "blindslist exceeds\n";
|
// cout << "blindslist exceeds\n";
|
||||||
if(actualSmallBlind == myGameData.firstSmallBlind) {
|
// if(actualSmallBlind == myGameData.firstSmallBlind) {
|
||||||
it = blindsList.begin();
|
// it = blindsList.begin();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
// else { cout << "blindslist is empty \n"; }
|
// else { cout << "blindslist is empty \n"; }
|
||||||
// Check if we can get an element of the list or the position exceeds the lis
|
// Check if we can get an element of the list or the position exceeds the lis
|
||||||
if (blindsList.empty() || it == blindsList.end()) {
|
// if (blindsList.empty() || it == blindsList.end()) {
|
||||||
|
|
||||||
|
else {
|
||||||
|
|
||||||
// The position exceeds the list
|
// The position exceeds the list
|
||||||
if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) {
|
if (myGameData.afterManualBlindsMode == AFTERMB_DOUBLE_BLINDS) {
|
||||||
@@ -340,9 +350,9 @@ void Game::raiseBlinds() {
|
|||||||
}
|
}
|
||||||
// else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; }
|
// else { /* Stay at last blind */ cout << "after blindslist stay at last blind \n"; }
|
||||||
}
|
}
|
||||||
} else {
|
// } else {
|
||||||
// Grab the blinds amount from the list
|
// Grab the blinds amount from the list
|
||||||
actualSmallBlind = *it;
|
// actualSmallBlind = *it;
|
||||||
// cout << "set new small blind from blindslist \n";
|
// cout << "set new small blind from blindslist \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ private:
|
|||||||
int lastHandBlindsRaised;
|
int lastHandBlindsRaised;
|
||||||
int lastTimeBlindsRaised;
|
int lastTimeBlindsRaised;
|
||||||
const GameData myGameData;
|
const GameData myGameData;
|
||||||
|
std::list<int> blindsList;
|
||||||
|
|
||||||
//timer
|
//timer
|
||||||
boost::timers::portable::second_timer blindsTimer;
|
boost::timers::portable::second_timer blindsTimer;
|
||||||
|
|||||||
Reference in New Issue
Block a user