adds activePlayerList and runningPlayerList (X) - !!! BROKEN !!! - last stable rev is 866
This commit is contained in:
@@ -12,11 +12,16 @@
|
||||
#ifndef BEROINTERFACE_H
|
||||
#define BEROINTERFACE_H
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <list>
|
||||
|
||||
#include "game_defs.h"
|
||||
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
*/
|
||||
class PlayerInterface;
|
||||
|
||||
typedef boost::shared_ptr<std::list<boost::shared_ptr<PlayerInterface> > > PlayerList;
|
||||
typedef std::list<boost::shared_ptr<PlayerInterface> >::iterator PlayerListIterator;
|
||||
|
||||
class BeRoInterface{
|
||||
public:
|
||||
|
||||
@@ -24,9 +29,11 @@ public:
|
||||
|
||||
virtual GameState getMyBeRoID() const =0;
|
||||
|
||||
|
||||
virtual void setPlayersTurn(int) =0;
|
||||
virtual int getPlayersTurn() const =0;
|
||||
|
||||
virtual void setCurrentPlayersTurnIt(PlayerListIterator) =0;
|
||||
virtual PlayerListIterator getCurrentPlayersTurnIt() const =0;
|
||||
|
||||
virtual void setHighestSet(int) =0;
|
||||
virtual int getHighestSet() const =0;
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
using namespace std;
|
||||
|
||||
LocalBeRo::LocalBeRo(HandInterface* hi, int id, int dP, int sB, GameState gS)
|
||||
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), firstRun(1), firstRound(1), firstHeadsUpRound(1), playersTurn(dP), logBoardCardsDone(0)
|
||||
: BeRoInterface(), myHand(hi), myBeRoID(gS), myID(id), dealerPosition(dP), smallBlindPosition(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), firstRun(1), firstRound(1), firstHeadsUpRound(1), logBoardCardsDone(0)
|
||||
{
|
||||
currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
|
||||
lastPlayersTurnIt = myHand->getRunningPlayerList()->begin();
|
||||
|
||||
int i;
|
||||
|
||||
@@ -33,7 +35,12 @@ LocalBeRo::~LocalBeRo()
|
||||
|
||||
void LocalBeRo::nextPlayer() {
|
||||
|
||||
myHand->getPlayerArray()[playersTurn]->action();
|
||||
// myHand->getPlayerArray()[playersTurn]->action();
|
||||
|
||||
|
||||
cout << "playerID in nextPlayer(): " << (*currentPlayersTurnIt)->getMyID() << endl;
|
||||
|
||||
(*currentPlayersTurnIt)->action();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
GameState getMyBeRoID() const { return myBeRoID; }
|
||||
|
||||
int getHighestCardsValue() const { std::cout << "getHighestCardsValue() in wrong BeRo" << std::endl; return 0; }
|
||||
void setHighestCardsValue(int theValue) { }
|
||||
void setHighestCardsValue(int /*theValue*/) { }
|
||||
|
||||
void setMinimumRaise ( int theValue ) { minimumRaise = theValue; }
|
||||
int getMinimumRaise() const { return minimumRaise; }
|
||||
@@ -51,7 +51,13 @@ protected:
|
||||
void setDealerPosition(int theValue) { dealerPosition = theValue; }
|
||||
|
||||
void setPlayersTurn(int theValue) { playersTurn = theValue; }
|
||||
int getPlayersTurn() const { return playersTurn; }
|
||||
int getPlayersTurn() const { return playersTurn;}
|
||||
|
||||
void setCurrentPlayersTurnIt(PlayerListIterator theValue) { currentPlayersTurnIt = theValue; }
|
||||
PlayerListIterator getCurrentPlayersTurnIt() const { return currentPlayersTurnIt; }
|
||||
|
||||
void setLastPlayersTurnIt(PlayerListIterator theValue) { lastPlayersTurnIt = theValue; }
|
||||
PlayerListIterator getLastPlayersTurnIt() const { return lastPlayersTurnIt; }
|
||||
|
||||
void setHighestSet(int theValue) { highestSet = theValue; }
|
||||
int getHighestSet() const { return highestSet;}
|
||||
@@ -87,7 +93,10 @@ private:
|
||||
bool firstRun;
|
||||
bool firstRound;
|
||||
bool firstHeadsUpRound;
|
||||
int playersTurn;
|
||||
|
||||
int playersTurn; // TODO -> delete
|
||||
PlayerListIterator currentPlayersTurnIt; // iterator for runningPlayerList
|
||||
PlayerListIterator lastPlayersTurnIt; // iterator for runningPlayerList
|
||||
|
||||
bool logBoardCardsDone;
|
||||
|
||||
|
||||
@@ -29,19 +29,90 @@ LocalBeRoPreflop::LocalBeRoPreflop(HandInterface* hi, int id, int dP, int sB) :
|
||||
{
|
||||
setHighestSet(2*getSmallBlind());
|
||||
|
||||
// // BigBlind ermitteln
|
||||
PlayerListIterator it;
|
||||
|
||||
// determine bigBlindPlayer
|
||||
bigBlindPositionIt = getMyHand()->getActivePlayerList()->begin();
|
||||
|
||||
for(bigBlindPositionIt=getMyHand()->getActivePlayerList()->begin(); bigBlindPositionIt!=getMyHand()->getActivePlayerList()->end(); bigBlindPositionIt++) {
|
||||
if((*bigBlindPositionIt)->getMyButton() == BUTTON_BIG_BLIND) break;
|
||||
}
|
||||
|
||||
if(bigBlindPositionIt == getMyHand()->getActivePlayerList()->end()) cout << "!!!" << endl;
|
||||
// search player in runningPlayerList before first action player -> run() determine next player who will do first action
|
||||
PlayerListIterator it_1, it_2;
|
||||
|
||||
// search bigBlindPosition in runningPlayerList
|
||||
it_1 = find(getMyHand()->getRunningPlayerList()->begin(), getMyHand()->getRunningPlayerList()->end(), *bigBlindPositionIt);
|
||||
|
||||
// more than 2 players are still active -> runningPlayerList is not empty
|
||||
if(getMyHand()->getActivePlayerList()->size() > 2) {
|
||||
|
||||
// bigBlindPlayer not found in runningPlayerList (he is all in) -> bigBlindPlayer is not the running player before first action player
|
||||
if(it_1 == getMyHand()->getRunningPlayerList()->end()) {
|
||||
|
||||
// search smallBlindPosition in runningPlayerList
|
||||
PlayerListIterator smallBlindPositionIt = bigBlindPositionIt;
|
||||
smallBlindPositionIt--;
|
||||
it_2 = find(getMyHand()->getRunningPlayerList()->begin(), getMyHand()->getRunningPlayerList()->end(), *smallBlindPositionIt);
|
||||
|
||||
// smallBlindPlayer not found in runningPlayerList (he is all in) -> next active player before smallBlindPlayer is running player before first action player
|
||||
if(it_2 == getMyHand()->getRunningPlayerList()->end()) {
|
||||
it_2 = smallBlindPositionIt;
|
||||
it_2--;
|
||||
setLastPlayersTurnIt(it_2);
|
||||
}
|
||||
// smallBlindPlayer found in runningPlayerList -> running player before first action player
|
||||
else {
|
||||
setLastPlayersTurnIt(it_2);
|
||||
}
|
||||
}
|
||||
// bigBlindPlayer found in runningPlayerList -> player before first action player
|
||||
else {
|
||||
setLastPlayersTurnIt(it_1);
|
||||
}
|
||||
}
|
||||
// heads up -> dealer/smallBlindPlayer is first action player and bigBlindPlayer is player before
|
||||
else {
|
||||
setLastPlayersTurnIt(it_1);
|
||||
}
|
||||
|
||||
setCurrentPlayersTurnIt(getLastPlayersTurnIt());
|
||||
|
||||
cout << "playerID constructor preflopRun(): " << (*(getCurrentPlayersTurnIt()))->getMyID() << endl;
|
||||
|
||||
|
||||
/////////////// testing
|
||||
|
||||
|
||||
|
||||
|
||||
it_1 = find(getMyHand()->getRunningPlayerList()->begin(), getMyHand()->getRunningPlayerList()->end(), *bigBlindPositionIt);
|
||||
|
||||
// bigBlindPosition is not all in
|
||||
// if(it!=getMyHand()->getRunningPlayerList()->end()) {
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
// if(it_1!=getMyHand()->getRunningPlayerList()->end()) {
|
||||
// cout << getMyHand()->getMyID() << ": " << "gefunden!" << endl;
|
||||
// cout << "\t PlayerID: " << (*it_1)->getMyID() << endl;
|
||||
// it_2 = it_1;
|
||||
// if(it_1 == getMyHand()->getRunningPlayerList()->begin()) it_1 = getMyHand()->getRunningPlayerList()->end();
|
||||
// it_1--;
|
||||
// cout << "\t PlayerID vor bigBlind: " << (*it_1)->getMyID() << endl;
|
||||
// cout << "\t PlayerID vor bigBlind: " << (*it_2)->getMyID() << endl;
|
||||
// } else {
|
||||
// cout << getMyHand()->getMyID() << ": " << "nicht gefunden" << endl;
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
//////////////// old
|
||||
|
||||
// set first runningPlayer before bigBlindPlayer to playersTurn -> run() determine next one who will do first action
|
||||
// setPlayersTurn((*bigBlindPositionIt)->getMyID());
|
||||
|
||||
|
||||
|
||||
// // erste Spielernummer fr preflopRun() setzen
|
||||
setPlayersTurn((*bigBlindPositionIt)->getMyID());
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +131,8 @@ void LocalBeRoPreflop::run() {
|
||||
bool allHighestSet = true;
|
||||
PlayerListIterator it;
|
||||
|
||||
|
||||
|
||||
// test if all running players have same sets (else allHighestSet = false)
|
||||
for(it=getMyHand()->getRunningPlayerList()->begin(); it!=getMyHand()->getRunningPlayerList()->end(); it++) {
|
||||
if(getHighestSet() != (*it)->getMySet()) {
|
||||
@@ -68,17 +141,41 @@ void LocalBeRoPreflop::run() {
|
||||
}
|
||||
|
||||
// determine next player
|
||||
for(i=0; (i<MAX_NUMBER_OF_PLAYERS && (!(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyActiveStatus()) || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_FOLD || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_ALLIN)) || i==0; i++) {
|
||||
|
||||
setPlayersTurn((getPlayersTurn()+1)%(MAX_NUMBER_OF_PLAYERS));
|
||||
// falls BigBlind, dann PreflopFirstRound zuende
|
||||
if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND && (*bigBlindPositionIt)->getMySet() < 2*getSmallBlind()) setFirstRound(0);
|
||||
// if next player is small blind and only all-in-big-blind with <= 2*smallblind is nonfold too
|
||||
if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_SMALL_BLIND && (*bigBlindPositionIt)->getMySet() < 2*getSmallBlind() && getMyHand()->getRunningPlayerList()->size() == 1) {
|
||||
setFirstRound(0);
|
||||
cout << "playerID begin preflopRun(): " << (*(getCurrentPlayersTurnIt()))->getMyID() << endl;
|
||||
|
||||
it = getCurrentPlayersTurnIt();
|
||||
|
||||
it++;
|
||||
|
||||
setCurrentPlayersTurnIt(it);
|
||||
|
||||
if(getCurrentPlayersTurnIt() == getMyHand()->getRunningPlayerList()->end()) setCurrentPlayersTurnIt(getMyHand()->getRunningPlayerList()->begin());
|
||||
|
||||
if(getCurrentPlayersTurnIt() == getMyHand()->getRunningPlayerList()->end()) cout << "!!!" << endl;
|
||||
|
||||
cout << "playerID middle preflopRun(): " << (*(getCurrentPlayersTurnIt()))->getMyID() << endl;
|
||||
|
||||
// exceptions
|
||||
// if next player is small blind and only all-in-big-blind with less than smallblind amount is nonfold too -> preflop is over
|
||||
if((*(getCurrentPlayersTurnIt()))->getMyButton() == BUTTON_SMALL_BLIND && (*bigBlindPositionIt)->getMySet() <= getSmallBlind() && getMyHand()->getRunningPlayerList()->size() == 1) {
|
||||
setFirstRound(false);
|
||||
allHighestSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// determine next player
|
||||
// for(i=0; (i<MAX_NUMBER_OF_PLAYERS && (!(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyActiveStatus()) || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_FOLD || getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyAction() == PLAYER_ACTION_ALLIN)) || i==0; i++) {
|
||||
//
|
||||
// setPlayersTurn((getPlayersTurn()+1)%(MAX_NUMBER_OF_PLAYERS));
|
||||
// // falls BigBlind, dann PreflopFirstRound zuende
|
||||
// if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND && (*bigBlindPositionIt)->getMySet() < 2*getSmallBlind()) setFirstRound(false);
|
||||
// // if next player is small blind and only all-in-big-blind with <= 2*smallblind is nonfold too
|
||||
// if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_SMALL_BLIND && (*bigBlindPositionIt)->getMySet() <= getSmallBlind() && getMyHand()->getRunningPlayerList()->size() == 1) {
|
||||
// setFirstRound(false);
|
||||
// allHighestSet = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// prfen, ob Preflop wirklich dran ist
|
||||
if(!getFirstRound() && allHighestSet) {
|
||||
@@ -88,9 +185,15 @@ void LocalBeRoPreflop::run() {
|
||||
getMyHand()->setActualRound(GAME_STATE_FLOP);
|
||||
|
||||
//Action loeschen und ActionButtons refresh
|
||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_ALLIN) getMyHand()->getPlayerArray()[i]->setMyAction(PLAYER_ACTION_NONE);
|
||||
for(it=getMyHand()->getRunningPlayerList()->begin(); it!=getMyHand()->getRunningPlayerList()->end(); it++) {
|
||||
(*it)->setMyAction(PLAYER_ACTION_NONE);
|
||||
}
|
||||
|
||||
//Action loeschen und ActionButtons refresh
|
||||
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
// if(getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_ALLIN) getMyHand()->getPlayerArray()[i]->setMyAction(PLAYER_ACTION_NONE);
|
||||
// }
|
||||
|
||||
//Sets in den Pot verschieben und Sets = 0 und Pot-refresh
|
||||
getMyHand()->getBoard()->collectSets();
|
||||
getMyHand()->getBoard()->collectPot();
|
||||
@@ -106,14 +209,27 @@ void LocalBeRoPreflop::run() {
|
||||
// Preflop ist wirklich dran
|
||||
|
||||
// falls BigBlind, dann PreflopFirstRound zuende
|
||||
if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND) setFirstRound(0);
|
||||
// if(getMyHand()->getPlayerArray()[getPlayersTurn()]->getMyButton() == BUTTON_BIG_BLIND) setFirstRound(0);
|
||||
|
||||
// lastPlayersTurn -> PreflopFirstRound is over
|
||||
if( (*(getCurrentPlayersTurnIt())) == (*(getLastPlayersTurnIt())) ) {
|
||||
setFirstRound(false);
|
||||
}
|
||||
|
||||
// getMyHand()->getPlayerArray()[getPlayersTurn()]->setMyTurn(1);
|
||||
|
||||
(*(getCurrentPlayersTurnIt()))->setMyTurn(true);
|
||||
|
||||
getMyHand()->getPlayerArray()[getPlayersTurn()]->setMyTurn(1);
|
||||
//highlight active players groupbox and clear action
|
||||
getMyHand()->getGuiInterface()->refreshGroupbox(getPlayersTurn(),2);
|
||||
getMyHand()->getGuiInterface()->refreshAction(getPlayersTurn(),PLAYER_ACTION_NONE);
|
||||
// getMyHand()->getGuiInterface()->refreshGroupbox(getPlayersTurn(),2);
|
||||
// getMyHand()->getGuiInterface()->refreshAction(getPlayersTurn(),PLAYER_ACTION_NONE);
|
||||
|
||||
if(getPlayersTurn() == 0) {
|
||||
//highlight active players groupbox and clear action
|
||||
getMyHand()->getGuiInterface()->refreshGroupbox( (*(getCurrentPlayersTurnIt()))->getMyID() , 2 );
|
||||
getMyHand()->getGuiInterface()->refreshAction( (*(getCurrentPlayersTurnIt()))->getMyID() , PLAYER_ACTION_NONE );
|
||||
|
||||
|
||||
if((*(getCurrentPlayersTurnIt()))->getMyID() == 0) {
|
||||
// Wir sind dran
|
||||
getMyHand()->getGuiInterface()->meInAction();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
void run();
|
||||
|
||||
private:
|
||||
PlayerListIterator bigBlindPositionIt;
|
||||
PlayerListIterator bigBlindPositionIt; // iterator for activePlayerList
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -105,43 +105,43 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
||||
|
||||
case 1: {
|
||||
|
||||
tempBoardArray[0] = 5;
|
||||
tempBoardArray[1] = 51;
|
||||
tempBoardArray[2] = 3;
|
||||
tempBoardArray[3] = 21;
|
||||
tempBoardArray[4] = 13;
|
||||
|
||||
myBoard->setMyCards(tempBoardArray);
|
||||
|
||||
tempPlayerAndBoardArray[2] = tempBoardArray[0];
|
||||
tempPlayerAndBoardArray[3] = tempBoardArray[1];
|
||||
tempPlayerAndBoardArray[4] = tempBoardArray[2];
|
||||
tempPlayerAndBoardArray[5] = tempBoardArray[3];
|
||||
tempPlayerAndBoardArray[6] = tempBoardArray[4];
|
||||
|
||||
// player0
|
||||
|
||||
tempPlayerArray[0] = 7;
|
||||
tempPlayerArray[1] = 37;
|
||||
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
|
||||
playerArray[0]->setMyCards(tempPlayerArray);
|
||||
playerArray[0]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
|
||||
playerArray[0]->setMyBestHandPosition(temp5Array);
|
||||
|
||||
// player1
|
||||
|
||||
tempPlayerArray[0] = 24;
|
||||
tempPlayerArray[1] = 19;
|
||||
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
|
||||
playerArray[1]->setMyCards(tempPlayerArray);
|
||||
playerArray[1]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
|
||||
playerArray[1]->setMyBestHandPosition(temp5Array);
|
||||
// tempBoardArray[0] = 5;
|
||||
// tempBoardArray[1] = 51;
|
||||
// tempBoardArray[2] = 3;
|
||||
// tempBoardArray[3] = 21;
|
||||
// tempBoardArray[4] = 13;
|
||||
//
|
||||
// myBoard->setMyCards(tempBoardArray);
|
||||
//
|
||||
// tempPlayerAndBoardArray[2] = tempBoardArray[0];
|
||||
// tempPlayerAndBoardArray[3] = tempBoardArray[1];
|
||||
// tempPlayerAndBoardArray[4] = tempBoardArray[2];
|
||||
// tempPlayerAndBoardArray[5] = tempBoardArray[3];
|
||||
// tempPlayerAndBoardArray[6] = tempBoardArray[4];
|
||||
//
|
||||
// // player0
|
||||
//
|
||||
// tempPlayerArray[0] = 7;
|
||||
// tempPlayerArray[1] = 37;
|
||||
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
//
|
||||
// playerArray[0]->setMyCards(tempPlayerArray);
|
||||
// playerArray[0]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
//
|
||||
// playerArray[0]->setMyBestHandPosition(temp5Array);
|
||||
//
|
||||
// // player1
|
||||
//
|
||||
// tempPlayerArray[0] = 24;
|
||||
// tempPlayerArray[1] = 19;
|
||||
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
//
|
||||
// playerArray[1]->setMyCards(tempPlayerArray);
|
||||
// playerArray[1]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
//
|
||||
// playerArray[1]->setMyBestHandPosition(temp5Array);
|
||||
|
||||
// player2
|
||||
|
||||
@@ -157,27 +157,27 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
|
||||
|
||||
// player3
|
||||
|
||||
tempPlayerArray[0] = 38;
|
||||
tempPlayerArray[1] = 22;
|
||||
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
|
||||
playerArray[3]->setMyCards(tempPlayerArray);
|
||||
playerArray[3]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
|
||||
playerArray[3]->setMyBestHandPosition(temp5Array);
|
||||
// tempPlayerArray[0] = 38;
|
||||
// tempPlayerArray[1] = 22;
|
||||
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
//
|
||||
// playerArray[3]->setMyCards(tempPlayerArray);
|
||||
// playerArray[3]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
//
|
||||
// playerArray[3]->setMyBestHandPosition(temp5Array);
|
||||
|
||||
// player4
|
||||
|
||||
tempPlayerArray[0] = 25;
|
||||
tempPlayerArray[1] = 16;
|
||||
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
|
||||
playerArray[3]->setMyCards(tempPlayerArray);
|
||||
playerArray[3]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
|
||||
playerArray[3]->setMyBestHandPosition(temp5Array);
|
||||
// tempPlayerArray[0] = 25;
|
||||
// tempPlayerArray[1] = 16;
|
||||
// tempPlayerAndBoardArray[0] = tempPlayerArray[0];
|
||||
// tempPlayerAndBoardArray[1] = tempPlayerArray[1];
|
||||
//
|
||||
// playerArray[3]->setMyCards(tempPlayerArray);
|
||||
// playerArray[3]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
|
||||
//
|
||||
// playerArray[3]->setMyBestHandPosition(temp5Array);
|
||||
|
||||
|
||||
} break;
|
||||
@@ -367,6 +367,8 @@ void LocalHand::assignButtons() {
|
||||
|
||||
void LocalHand::switchRounds() {
|
||||
|
||||
// cout << "playerID begin switchRounds(): " << getCurrentBeRo()->get
|
||||
|
||||
int i;
|
||||
PlayerListIterator it;
|
||||
|
||||
|
||||
@@ -856,23 +856,23 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
|
||||
|
||||
if(myID==0) {
|
||||
// myActiveStatus=0;
|
||||
myCash=14800;
|
||||
// myCash=14800;
|
||||
}
|
||||
|
||||
if(myID==1) {
|
||||
myCash=400;
|
||||
// myCash=400;
|
||||
}
|
||||
if(myID==2) {
|
||||
myCash=4950;
|
||||
myCash=50;
|
||||
}
|
||||
if(myID==3) {
|
||||
myCash=5250;
|
||||
// myCash=5250;
|
||||
}
|
||||
if(myID==4) {
|
||||
myCash=5100;
|
||||
// myCash=5100;
|
||||
}
|
||||
if(myID==5) {
|
||||
myCash=4500;
|
||||
// myCash=4500;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -976,7 +976,7 @@ void LocalPlayer::action() {
|
||||
actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
|
||||
actualHand->getGuiInterface()->nextPlayerAnimation();
|
||||
|
||||
|
||||
cout << "playerID in action(): " << (*(actualHand->getCurrentBeRo()->getCurrentPlayersTurnIt()))->getMyID() << endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -1183,7 +1183,7 @@ void LocalPlayer::preflopEngine() {
|
||||
|
||||
switch(actualHand->getMyID()) {
|
||||
case 1: {
|
||||
myAction = PLAYER_ACTION_CALL;
|
||||
// myAction = PLAYER_ACTION_CALL;
|
||||
}
|
||||
break;
|
||||
case 2: {
|
||||
@@ -1201,7 +1201,7 @@ void LocalPlayer::preflopEngine() {
|
||||
|
||||
switch(actualHand->getMyID()) {
|
||||
case 1: {
|
||||
myAction = PLAYER_ACTION_FOLD;
|
||||
// myAction = PLAYER_ACTION_FOLD;
|
||||
// raise = 20;
|
||||
// if(mySet >= 40) {
|
||||
// myAction = PLAYER_ACTION_CALL;
|
||||
@@ -1223,15 +1223,15 @@ void LocalPlayer::preflopEngine() {
|
||||
}
|
||||
break;
|
||||
case 3: {
|
||||
myAction = PLAYER_ACTION_CALL;
|
||||
// myAction = PLAYER_ACTION_CALL;
|
||||
}
|
||||
break;
|
||||
case 4: {
|
||||
myAction = PLAYER_ACTION_CALL;
|
||||
// myAction = PLAYER_ACTION_CALL;
|
||||
}
|
||||
break;
|
||||
case 5: {
|
||||
myAction = PLAYER_ACTION_FOLD;
|
||||
// myAction = PLAYER_ACTION_FOLD;
|
||||
}
|
||||
break;
|
||||
default: {}
|
||||
|
||||
@@ -67,6 +67,30 @@ ClientBeRo::getPlayersTurn() const
|
||||
return playersTurn;
|
||||
}
|
||||
|
||||
void
|
||||
ClientBeRo::setCurrentPlayersTurnIt(PlayerListIterator theValue)
|
||||
{
|
||||
currentPlayersTurnIt = theValue;
|
||||
}
|
||||
|
||||
PlayerListIterator
|
||||
ClientBeRo::getCurrentPlayersTurnIt() const
|
||||
{
|
||||
return currentPlayersTurnIt;
|
||||
}
|
||||
|
||||
void
|
||||
ClientBeRo::setLastPlayersTurnIt(PlayerListIterator theValue)
|
||||
{
|
||||
lastPlayersTurnIt = theValue;
|
||||
}
|
||||
|
||||
PlayerListIterator
|
||||
ClientBeRo::getLastPlayersTurnIt() const
|
||||
{
|
||||
return lastPlayersTurnIt;
|
||||
}
|
||||
|
||||
void
|
||||
ClientBeRo::setHighestSet(int theValue)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,12 @@ public:
|
||||
|
||||
void setPlayersTurn(int theValue);
|
||||
int getPlayersTurn() const;
|
||||
|
||||
void setCurrentPlayersTurnIt(PlayerListIterator theValue);
|
||||
PlayerListIterator getCurrentPlayersTurnIt() const;
|
||||
|
||||
void setLastPlayersTurnIt(PlayerListIterator theValue);
|
||||
PlayerListIterator getLastPlayersTurnIt() const;
|
||||
|
||||
void setHighestSet(int theValue);
|
||||
int getHighestSet() const;
|
||||
@@ -68,7 +74,11 @@ private:
|
||||
HandInterface *myHand;
|
||||
|
||||
int highestCardsValue;
|
||||
int playersTurn;
|
||||
|
||||
int playersTurn; // TODO -> delete
|
||||
PlayerListIterator currentPlayersTurnIt; // iterator for runningPlayerList
|
||||
PlayerListIterator lastPlayersTurnIt; // iterator for runningPlayerList
|
||||
|
||||
int highestSet;
|
||||
bool firstRound;
|
||||
int smallBlindPosition;
|
||||
|
||||
Reference in New Issue
Block a user