adds activePlayerList and runningPlayerList (XVIII)

This commit is contained in:
doitux committed 2007-09-27 18:07:03 +00:00
1 parent 78bf4820af
commit 6d30e324e0
7 files changed
+267 -90

No files matched your search

+11 -2
View File
@@ -292,8 +292,17 @@ void LocalBeRo::run() {
// aktuelle bero ist wirklich dran
// Anzahl der effektiv gespielten Runden (des human player) erhöhen
if(myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1) {
myHand->setBettingRoundsPlayed(myBeRoID);
// if(myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1) {
// myHand->setBettingRoundsPlayed(myBeRoID);
// }
// Anzahl der effektiv gespielten Runden (des human player) erhöhen
it_c = myHand->getActivePlayerIt(0);
if( it_c != myHand->getActivePlayerList()->end() ) {
// human player is active
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
myHand->setBettingRoundsPlayed(myBeRoID);
}
}
//// !!!!!!!!!!!!!!!!1!!!! very buggy, rule breaking -> TODO !!!!!!!!!!!!11!!!!!!!! //////////////
+44 -7
View File
@@ -38,30 +38,63 @@ void LocalBeRoPostRiver::run() {
void LocalBeRoPostRiver::postRiverRun() {
int i;
// int i;
PlayerListConstIterator it_c;
PlayerListIterator it;
//berechnen welcher Spieler gewonnen hat
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
//
// if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyCardsValueInt() > highestCardsValue ) {
// highestCardsValue = getMyHand()->getPlayerArray()[i]->getMyCardsValueInt();
// }
// }
if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyCardsValueInt() > highestCardsValue ) {
highestCardsValue = getMyHand()->getPlayerArray()[i]->getMyCardsValueInt();
//berechnen welcher Spieler gewonnen hat
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() > highestCardsValue ) {
highestCardsValue = (*it_c)->getMyCardsValueInt();
}
}
// Durchschnittsets des human player ermitteln
// getMyHand()->getPlayerArray()[0]->setMyAverageSets(((getMyHand()->getPlayerArray()[0]->getMyRoundStartCash())-(getMyHand()->getPlayerArray()[0]->getMyCash()))/(getMyHand()->getBettingRoundsPlayed()+1));
// Aggressivität des human player ermitteln
// anzahl der player die möglichkeit haben am pot teilzuhaben
int potPlayers = 0;
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD) {
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
// if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD) {
// potPlayers++;
// }
// }
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
potPlayers++;
}
}
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
getMyHand()->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && getMyHand()->getPlayerArray()[0]->getMyActiveStatus() && getMyHand()->getPlayerArray()[0]->getMyAction() != PLAYER_ACTION_FOLD);
// getMyHand()->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && getMyHand()->getPlayerArray()[0]->getMyActiveStatus() && getMyHand()->getPlayerArray()[0]->getMyAction() != PLAYER_ACTION_FOLD);
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
it = getMyHand()->getActivePlayerIt(0);
if( it != getMyHand()->getActivePlayerList()->end() ) {
if( potPlayers == 1 && (*it)->getMyAction() != PLAYER_ACTION_FOLD ) {
(*it)->setMyAggressive(true);
}
}
// cout << "myAggressive: " << getMyHand()->getPlayerArray()[0]->getMyAggressive() << endl;
@@ -75,6 +108,8 @@ void LocalBeRoPostRiver::postRiverRun() {
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
}
/*
void LocalBeRoPostRiver::distributePot() {
// int potCalcAllinArray[5][2]; // 0 -> ID , 1 -> AllInCash
@@ -346,3 +381,5 @@ void LocalBeRoPostRiver::distributePot() {
}
*/
+1 -1
View File
@@ -37,7 +37,7 @@ public:
void run();
void postRiverRun();
void distributePot();
// void distributePot();
private:
+78 -20
View File
@@ -985,6 +985,7 @@ void LocalPlayer::preflopEngine() {
int bet = 0;
int raise = 0;
int cBluff;
PlayerListConstIterator it_c;
// temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler
int players = actualHand->getActivePlayerList()->size();
@@ -1018,14 +1019,24 @@ void LocalPlayer::preflopEngine() {
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
// cout << aggValue << " ";
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
//
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
// myNiveau[0] -= aggValue;
// myNiveau[2] -= aggValue;
// }
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
myNiveau[0] -= aggValue;
myNiveau[2] -= aggValue;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
it_c = actualHand->getActivePlayerIt(0);
if( it_c != actualHand->getActivePlayerList()->end() ) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
myNiveau[0] -= aggValue;
myNiveau[2] -= aggValue;
}
}
@@ -1253,6 +1264,7 @@ void LocalPlayer::flopEngine() {
int cBluff;
int pBluff;
int rand;
PlayerListConstIterator it_c;
// übergang solange preflopValue und flopValue noch nicht bereinigt
int players = actualHand->getActivePlayerList()->size();
@@ -1273,14 +1285,27 @@ void LocalPlayer::flopEngine() {
if(individualHighestSet > myCash) individualHighestSet = myCash;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
//
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
// for(i=0; i<3; i++) {
// myNiveau[i] -= aggValue;
// }
// }
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
for(i=0; i<3; i++) {
myNiveau[i] -= aggValue;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
it_c = actualHand->getActivePlayerIt(0);
if( it_c != actualHand->getActivePlayerList()->end() ) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
for(i=0; i<3; i++) {
myNiveau[i] -= aggValue;
}
}
}
// Check-Bluff generieren
Tools::getRandNumber(1,100,1,&cBluff,0);
@@ -1831,6 +1856,7 @@ void LocalPlayer::turnEngine() {
int cBluff;
int pBluff;
int rand;
PlayerListConstIterator it_c;
calcMyOdds();
@@ -1843,13 +1869,29 @@ void LocalPlayer::turnEngine() {
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
//
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
// for(i=0; i<3; i++) {
// myNiveau[i] -= aggValue;
// }
// }
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
for(i=0; i<3; i++) {
myNiveau[i] -= aggValue;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
it_c = actualHand->getActivePlayerIt(0);
if( it_c != actualHand->getActivePlayerList()->end() ) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
for(i=0; i<3; i++) {
myNiveau[i] -= aggValue;
}
}
}
// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl;
@@ -2167,6 +2209,7 @@ void LocalPlayer::riverEngine() {
int i;
int rand;
int pBluff;
PlayerListConstIterator it_c;
calcMyOdds();
@@ -2179,13 +2222,28 @@ void LocalPlayer::riverEngine() {
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
//
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
// for(i=0; i<3; i++) {
// myNiveau[i] -= aggValue;
// }
// }
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
for(i=0; i<3; i++) {
myNiveau[i] -= aggValue;
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
it_c = actualHand->getActivePlayerIt(0);
if( it_c != actualHand->getActivePlayerList()->end() ) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
for(i=0; i<3; i++) {
myNiveau[i] -= aggValue;
}
}
}
// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl;
@@ -4245,8 +4303,8 @@ void LocalPlayer::riverEngine3() {
// temp fr das Vielfache des Small Blind, sodass HighestSet zu hoch ist
int tempFold;
tempFold = (actualHand->getPlayerArray()[0]->getMyAverageSets())/(6*actualHand->getSmallBlind());
// Tools::getRandNumber(4,6,1,&tempFold,0);
// tempFold = (actualHand->getPlayerArray()[0]->getMyAverageSets())/(6*actualHand->getSmallBlind());
Tools::getRandNumber(4,6,1,&tempFold,0);
// FOLD
// --> wenn potential negativ oder HighestSet zu hoch