This commit is contained in:
doitux
2007-03-29 22:58:04 +00:00
parent c1f7a257f1
commit 1c7f572fbf
19 changed files with 525 additions and 267 deletions
+6 -3
View File
@@ -76,8 +76,11 @@ void LocalFlop::flopRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
}
@@ -100,7 +103,7 @@ void LocalFlop::flopRun() {
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
+5 -2
View File
@@ -25,6 +25,8 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
{
int i, j, k;
lastPlayersTurn = 0;
CardsValue myCardsValue;
myGui->setHand(this);
@@ -47,7 +49,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
// Dealer, SB, BB bestimmen
assignButtons();
myGui->refreshAll();
// myGui->refreshAll();
// Karten generieren und Board sowie Player zuweisen
Tools myTool;
@@ -237,8 +239,9 @@ void LocalHand::switchRounds() {
actualRound++;
}
//unhighlight actual players groupbox
myGui->refreshGroupbox(lastPlayersTurn,1);
myGui->refreshGroupbox();
highlightRoundLabel();
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
//
+6
View File
@@ -81,6 +81,10 @@ public:
void setBettingRoundsPlayed(const int& theValue) { bettingRoundsPlayed = theValue; }
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
void setLastPlayersTurn(const int& theValue) { lastPlayersTurn = theValue; }
int getLastPlayersTurn() const { return lastPlayersTurn; }
void assignButtons();
void highlightRoundLabel();
@@ -114,6 +118,8 @@ private:
int startCash;
int activePlayersCounter;
int lastPlayersTurn;
bool allInCondition;
// hier steht bis zu welcher bettingRound der human player gespielt hat: 0 - nur Preflop, 1 - bis Flop, ...
+20 -15
View File
@@ -63,12 +63,15 @@ LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::strin
}
LocalPlayer::~LocalPlayer()
{
}
void LocalPlayer::setHand(HandInterface* br) { actualHand = br; }
void LocalPlayer::action() {
ConfigFile myConfig;
@@ -116,6 +119,9 @@ void LocalPlayer::action() {
myTurn = 0;
// cout << "jetzt" << endl;
//set that i was the last active player. need this for unhighlighting groupbox
actualHand->setLastPlayersTurn(myID);
actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
actualHand->getGuiInterface()->nextPlayerAnimation();
@@ -128,10 +134,11 @@ void LocalPlayer::preflopEngine() {
int bet = 0;
int raise = 0;
// übergang solange preflopValue und flopValue noch nicht bereinigt
// temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler
int players = actualHand->getActualQuantityPlayers();
if(players > 5) players = 5;
// myOdds auslesen
readFile();
// Niveaus setzen + Dude + Anzahl Gegenspieler
@@ -144,9 +151,7 @@ void LocalPlayer::preflopEngine() {
int individualHighestSet = actualHand->getPreflop()->getHighestSet();
if(individualHighestSet > myCash) individualHighestSet = myCash;
// Verhaeltnis Set / Cash
// Verhaeltnis Set / Cash für call
if(myCash/individualHighestSet >= 25) {
myNiveau[0] += (25-myCash/individualHighestSet)/10;
} else {
@@ -158,9 +163,17 @@ void LocalPlayer::preflopEngine() {
myNiveau[2] += (10-myCash/individualHighestSet)/2;
}
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
// Aggresivität des humanPlayers auslesen
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*0.1)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*7.0);
// if(aggValue > 0) {
// myNiveau[0] -= aggValue;
// myNiveau[2] -= aggValue;
// }
// auf Aggresivität des humanPlayers eingehen
// int aggValue = ( (50*(actualHand->getPlayerArray()[0]->getMyAverageSets()-6*actualHand->getSmallBlind())) / (actualHand->getStartQuantityPlayers()*actualHand->getStartCash() - 6*actualHand->getSmallBlind()) );
// if(aggValue > 0) {
@@ -869,7 +882,6 @@ void LocalPlayer::riverEngine() {
}
void LocalPlayer::evaluation(int bet, int raise) {
int highestSet = 0;
@@ -967,10 +979,6 @@ void LocalPlayer::evaluation(int bet, int raise) {
}
int LocalPlayer::preflopCardsValue(int* cards) {
// Code der HoleCards ermitteln
@@ -995,9 +1003,6 @@ int LocalPlayer::preflopCardsValue(int* cards) {
}
int LocalPlayer::flopCardsValue(int* cards) {
int array[5][3];
+5 -2
View File
@@ -83,8 +83,11 @@ void LocalPreflop::preflopRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
}
@@ -101,7 +104,7 @@ void LocalPreflop::preflopRun() {
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || myHand->getPlayerArray()[playersTurn]->getMyAction() == 1 || myHand->getPlayerArray()[playersTurn]->getMyAction() == 6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
if(playersTurn == 0) {
// Wir sind dran
+6 -5
View File
@@ -77,7 +77,10 @@ void LocalRiver::riverRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
@@ -100,7 +103,7 @@ void LocalRiver::riverRun() {
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
@@ -157,11 +160,9 @@ void LocalRiver::postRiverRun() {
}
}
// prüfen ob nur noch der human player an der verteilung teilnimmt
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
myHand->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1);
cout << "aggressive: " << myHand->getPlayerArray()[0]->getMyAggressive() << endl;
// Pot-Verteilung
distributePot();
+5 -2
View File
@@ -78,7 +78,10 @@ void LocalTurn::turnRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
@@ -101,7 +104,7 @@ void LocalTurn::turnRun() {
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;