diff --git a/pokerth.png b/pokerth.png new file mode 100644 index 00000000..e36e86aa Binary files /dev/null and b/pokerth.png differ diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 0dd8b002..eb0c72c0 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -58,6 +58,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe int tempBoardArray[5]; int tempPlayerArray[2]; int tempPlayerAndBoardArray[7]; + int sBluff; for(i=0; i<5; i++) { tempBoardArray[i] = cardsArray[i]; tempPlayerAndBoardArray[i+2] = cardsArray[i]; @@ -72,12 +73,20 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe } playerArray[i]->setMyCards(tempPlayerArray); playerArray[i]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,playerArray[i]->getMyBestHandPosition())); + // myBestHandPosition auf Fehler ueberpruefen for(j=0; j<5; j++) { if((playerArray[i]->getMyBestHandPosition())[j] == -1) { - cout << "FEHLER bei myBestHandPosition-Ermittlung!!!" << endl; + cout << "ERROR get myBestHandPosition in localhand.cpp" << endl; } } + + // sBluff für alle aktiver Spieler außer human player setzen + if(i) { + myTool.getRandNumber(1,100,1,&sBluff,0); + playerArray[i]->setSBluff(sBluff); + } + k++; } } diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 3e55b73c..f0f03371 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -23,7 +23,7 @@ using namespace std; -LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) : PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0) +LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) : PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0) { // myBestHandPosition mit -1 initialisieren int i; @@ -133,6 +133,8 @@ void LocalPlayer::preflopEngine() { int bet = 0; int raise = 0; + int cBluff; + Tools myTool; // temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler int players = actualHand->getActualQuantityPlayers(); @@ -143,7 +145,7 @@ void LocalPlayer::preflopEngine() { // Niveaus setzen + Dude + Anzahl Gegenspieler // 1. Fold -- Call - myNiveau[0] = 40 + myDude4 - 6*(players - 2); + myNiveau[0] = 42 + myDude4 - 6*(players - 2); // 3. Call -- Raise myNiveau[2] = 53 + myDude4 - 6*(players - 2); @@ -166,24 +168,18 @@ void LocalPlayer::preflopEngine() { // 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); + int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*14.0); -// if(aggValue > 0) { -// myNiveau[0] -= aggValue; -// myNiveau[2] -= aggValue; -// } +// cout << aggValue << " "; + myNiveau[0] -= aggValue; + myNiveau[2] -= aggValue; -// int aggValue = ( (50*(actualHand->getPlayerArray()[0]->getMyAverageSets()-6*actualHand->getSmallBlind())) / (actualHand->getStartQuantityPlayers()*actualHand->getStartCash() - 6*actualHand->getSmallBlind()) ); - -// if(aggValue > 0) { -// myNiveau[0] -= aggValue; -// myNiveau[2] -= aggValue; -// } -// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; - +// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; + // Check-Bluff generieren + myTool.getRandNumber(1,100,1,&cBluff,0); // aktive oder passivie Situation ? -> im preflop nur passiv @@ -201,7 +197,7 @@ void LocalPlayer::preflopEngine() { else { myAction = 3; } - + // Standard-Raise-Routine } else { // raise-Betrag ermitteln @@ -216,6 +212,13 @@ void LocalPlayer::preflopEngine() { } myAction = 5; } + + // auf cBluff testen --> call statt raise + if(cBluff > 80) myAction = 3; + if(cBluff > 70 && myOdds >= myNiveau[2] + 4) myAction = 3; + if(cBluff > 60 && myOdds >= myNiveau[2] + 8) myAction = 3; + if(cBluff > 50 && myOdds >= myNiveau[2] + 12) myAction = 3; + } else { // call @@ -232,6 +235,36 @@ void LocalPlayer::preflopEngine() { } } + cout << sBluff << endl; + + // auf sBluff testen --> raise statt call oder fold + if(sBluff < 100/(((actualHand->getActualQuantityPlayers()-2)*6)+3) && myOdds < myNiveau[2] && actualHand->getPreflop()->getHighestSet() == 2*actualHand->getSmallBlind()) { + + cout << "sBLUFF!" << endl; + + // Gegner raisen ebenfalls -> call + if(actualHand->getPreflop()->getHighestSet() >= 12*actualHand->getSmallBlind()) { + myAction = 3; + } + // Standard-Raise-Routine + else { + // raise-Betrag ermitteln + raise = (sBluff/(8-actualHand->getActualQuantityPlayers()))*actualHand->getSmallBlind(); + // raise-Betrag zu klein -> mindestens Standard-raise + if(raise < actualHand->getPreflop()->getHighestSet()) { + raise = actualHand->getPreflop()->getHighestSet(); + } + // all in bei nur wenigen Chips oder knappem raise + if(myCash/(2*actualHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) { + raise = myCash; + } + myAction = 5; + } + + + } + + evaluation(bet, raise); } @@ -240,6 +273,9 @@ void LocalPlayer::flopEngine() { int raise = 0; int bet = 0; + int i; + int cBluff; + Tools myTool; // übergang solange preflopValue und flopValue noch nicht bereinigt int players = actualHand->getActualQuantityPlayers(); @@ -249,24 +285,26 @@ void LocalPlayer::flopEngine() { // Niveaus setzen + Dude + Anzahl Gegenspieler // 1. Fold -- Call - myNiveau[0] = 40 + myDude4 - 6*(players - 2); + myNiveau[0] = 42 + myDude4 - 6*(players - 2); // 2. Check -- Bet - myNiveau[1] = 52 + myDude4 - 6*(players - 2); + myNiveau[1] = 54 + myDude4 - 6*(players - 2); // 3. Call -- Raise - myNiveau[2] = 64 + myDude4 - 6*(players - 2); - - // 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) { -// myNiveau[0] -= aggValue; -// myNiveau[2] -= aggValue; -// } + myNiveau[2] = 66 + myDude4 - 6*(players - 2); // eigenes mögliches highestSet int individualHighestSet = actualHand->getFlop()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; + // Aggresivität des humanPlayers auslesen + int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*14.0); + + for(i=0; i<3; i++) { + myNiveau[i] -= aggValue; + } + + // Check-Bluff generieren + myTool.getRandNumber(1,100,1,&cBluff,0); + // aktiv oder passiv? if(actualHand->getFlop()->getHighestSet() > 0) { @@ -311,6 +349,13 @@ void LocalPlayer::flopEngine() { } myAction = 5; } + + // auf cBluff testen --> call statt raise + if(cBluff > 90) myAction = 3; + if(cBluff > 80 && myOdds >= myNiveau[2] + 4) myAction = 3; + if(cBluff > 70 && myOdds >= myNiveau[2] + 8) myAction = 3; + if(cBluff > 60 && myOdds >= myNiveau[2] + 12) myAction = 3; + } else { // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt @@ -329,12 +374,8 @@ void LocalPlayer::flopEngine() { } } else { - // check - if(myOdds < myNiveau[1]) { - myAction = 2; - } // bet - else { + if(myOdds >= myNiveau[1]) { bet = (((int)myOdds-myNiveau[1])/8)*2*actualHand->getSmallBlind(); // bet zu klein if(bet == 0) { @@ -342,13 +383,23 @@ void LocalPlayer::flopEngine() { } // all in bei nur wenigen Chips if(myCash/(2*actualHand->getSmallBlind()) <= 6) { - raise = myCash; + bet = myCash; } // all in bei knappem bet if(bet > (myCash*4.0)/5.0) { bet = myCash; } myAction = 4; + + // auf cBluff testen --> check statt bet + if(cBluff > 80) myAction = 2; + if(cBluff > 70 && myOdds >= myNiveau[1] + 4) myAction = 2; + if(cBluff > 60 && myOdds >= myNiveau[1] + 8) myAction = 2; + if(cBluff > 50 && myOdds >= myNiveau[1] + 12) myAction = 2; + } + // bet + else { + myAction = 2; } } @@ -626,32 +677,37 @@ void LocalPlayer::turnEngine() { int raise = 0; int bet = 0; + int i; + int cBluff; + Tools myTool; readFile(); // Niveaus setzen + Dude + Anzahl Gegenspieler // 1. Fold -- Call - myNiveau[0] = 42 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + myNiveau[0] = 44 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; // 2. Check -- Bet - myNiveau[1] = 53 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + myNiveau[1] = 55 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; // 3. Call -- Raise - myNiveau[2] = 64 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + myNiveau[2] = 66 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; - // auf Aggresivität des humanPlayers eingehen -// int aggValue = ( (50*(actualHand->getPlayerArray()[0]->getMyAverageSets()-6*actualHand->getSmallBlind())) / (actualHand->getStartQuantityPlayers()*actualHand->getStartCash() - 6*actualHand->getSmallBlind()) ); +// Aggresivität des humanPlayers auslesen + int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*14.0); -// if(aggValue > 0) { -// myNiveau[0] -= aggValue; -// myNiveau[2] -= aggValue; -// } + 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; +// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; // eigenes mögliches highestSet int individualHighestSet = actualHand->getTurn()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; + // Check-Bluff generieren + myTool.getRandNumber(1,100,1,&cBluff,0); + // aktiv oder passiv? if(actualHand->getTurn()->getHighestSet() > 0) { @@ -696,6 +752,11 @@ void LocalPlayer::turnEngine() { } myAction = 5; } + // auf cBluff testen --> call statt raise + if(cBluff > 90) myAction = 3; + if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = 3; + if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = 3; + if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = 3; } else { // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt @@ -714,6 +775,147 @@ void LocalPlayer::turnEngine() { } } // aktiv + else { + // bet + if(myOdds >= myNiveau[1]) { + bet = (((int)myOdds-myNiveau[1])/6)*2*actualHand->getSmallBlind(); + if(bet == 0) { + bet = 2*actualHand->getSmallBlind(); + } + // all in bei nur wenigen Chips + if(myCash/(2*actualHand->getSmallBlind()) <= 6) { + bet = myCash; + } + // all in bei knappem bet + if(bet > (myCash*4.0)/5.0) { + bet = myCash; + } + myAction = 4; + + // auf cBluff testen --> call statt raise + if(cBluff > 90) myAction = 2; + if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = 2; + if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = 2; + if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = 2; + } + // check + else { + myAction = 2; + } + } + + evaluation(bet, raise); + +} + + +void LocalPlayer::riverEngine() { + + ConfigFile myConfig; + +// int tempArray[6]; +// int boardCards[5]; +// int i; + +// for(i=0; i<2; i++) tempArray[i] = myCards[i]; +// actualBoard->getMyCards(boardCards); +// for(i=0; i<4; i++) tempArray[2+i] = boardCards[i]; + +// for(i=0; i<5; i++) cout << tempArray[i] << " "; +// cout << endl; + +// cout << myID << ": "; + +// turnCardsValue(tempArray); + + + int raise = 0; + int bet = 0; + int i; + + readFile(); + + // Niveaus setzen + Dude + Anzahl Gegenspieler + // 1. Fold -- Call + myNiveau[0] = 44 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + // 2. Check -- Bet + myNiveau[1] = 55 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + // 3. Call -- Raise + myNiveau[2] = 66 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + + // Aggresivität des humanPlayers auslesen + int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*14.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; + + // eigenes mögliches highestSet + int individualHighestSet = actualHand->getRiver()->getHighestSet(); + if(individualHighestSet > myCash) individualHighestSet = myCash; + + // aktiv oder passiv? + if(actualHand->getRiver()->getHighestSet() > 0) { + + // Verhaeltnis Set / Cash + if(myCash/individualHighestSet >= 25) { + myNiveau[0] += (25-myCash/individualHighestSet)/10; + } else { + myNiveau[0] += (25-myCash/individualHighestSet)/3; + } + + // Verhaeltnis Set / Cash für raise + if(myCash/individualHighestSet < 10) { + myNiveau[2] += (10-myCash/individualHighestSet)/2; + } + + // raise (bei hohem Niveau) + if(myOdds >= myNiveau[2]) { + // raise-loop unterbinden -> d.h. entweder call oder bei superblatt all in + if(actualHand->getRiver()->getHighestSet() >= 12*actualHand->getSmallBlind()) { + // all in + if(myOdds >= myNiveau[2] + 8) { + raise = myCash; + myAction = 5; + } + // nur call + else { + myAction = 3; + } + } + // Standard-Raise-Routine + else { + // raise-Betrag ermitteln + raise = (((int)myOdds-myNiveau[2])/2)*2*actualHand->getSmallBlind(); + // raise-Betrag zu klein -> mindestens Standard-raise + if(raise == 0) { + raise = actualHand->getRiver()->getHighestSet(); + } + // all in bei nur wenigen Chips + if(myCash/(2*actualHand->getSmallBlind()) <= 8) { + raise = myCash; + } + myAction = 5; + } + } + else { + // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt + if(myOdds >= myNiveau[0] || (mySet >= actualHand->getRiver()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { + // all in bei knappem call + if(myCash-actualHand->getRiver()->getHighestSet() <= (myCash*1)/4) { + raise = myCash; + myAction = 5; + } + else myAction = 3; + } + // fold + else { + myAction = 1; + } + } + } else { // check if(myOdds < myNiveau[1]) { @@ -721,7 +923,7 @@ void LocalPlayer::turnEngine() { } // bet else { - bet = (((int)myOdds-myNiveau[1])/6)*2*actualHand->getSmallBlind(); + bet = (((int)myOdds-myNiveau[1])/3)*2*actualHand->getSmallBlind(); if(bet == 0) { bet = 2*actualHand->getSmallBlind(); } @@ -735,147 +937,11 @@ void LocalPlayer::turnEngine() { } myAction = 4; } + } evaluation(bet, raise); -} - - -void LocalPlayer::riverEngine() { - - ConfigFile myConfig; - -// int tempArray[6]; -// int boardCards[5]; -// int i; - -// for(i=0; i<2; i++) tempArray[i] = myCards[i]; -// actualBoard->getMyCards(boardCards); -// for(i=0; i<4; i++) tempArray[2+i] = boardCards[i]; - -// for(i=0; i<5; i++) cout << tempArray[i] << " "; -// cout << endl; - -// cout << myID << ": "; - -// turnCardsValue(tempArray); - - - int raise = 0; - int bet = 0; - - readFile(); - - // Niveaus setzen + Dude + Anzahl Gegenspieler - // 1. Fold -- Call - myNiveau[0] = 42 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; - // 2. Check -- Bet - myNiveau[1] = 53 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; - // 3. Call -- Raise - myNiveau[2] = 64 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; - - // 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) { -// myNiveau[0] -= aggValue; -// myNiveau[2] -= aggValue; -// } - -// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; - - // eigenes mögliches highestSet - int individualHighestSet = actualHand->getRiver()->getHighestSet(); - if(individualHighestSet > myCash) individualHighestSet = myCash; - - // aktiv oder passiv? - if(actualHand->getRiver()->getHighestSet() > 0) { - - // Verhaeltnis Set / Cash - if(myCash/individualHighestSet >= 25) { - myNiveau[0] += (25-myCash/individualHighestSet)/10; - } else { - myNiveau[0] += (25-myCash/individualHighestSet)/3; - } - - // Verhaeltnis Set / Cash für raise - if(myCash/individualHighestSet < 10) { - myNiveau[2] += (10-myCash/individualHighestSet)/2; - } - - // raise (bei hohem Niveau) - if(myOdds >= myNiveau[2]) { - - // raise-loop unterbinden -> d.h. entweder call oder bei superblatt all in - if(actualHand->getRiver()->getHighestSet() >= 12*actualHand->getSmallBlind()) { - // all in - if(myOdds >= myNiveau[2] + 8) { - raise = myCash; - myAction = 5; - } - // nur call - else { - myAction = 3; - } - - // Standard-Raise-Routine - } else { - // raise-Betrag ermitteln - raise = (((int)myOdds-myNiveau[2])/2)*2*actualHand->getSmallBlind(); - // raise-Betrag zu klein -> mindestens Standard-raise - if(raise == 0) { - raise = actualHand->getRiver()->getHighestSet(); - } - // all in bei nur wenigen Chips - if(myCash/(2*actualHand->getSmallBlind()) <= 8) { - raise = myCash; - } - myAction = 5; - } - } - else { - // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt - if(myOdds >= myNiveau[0] || (mySet >= actualHand->getRiver()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { - // all in bei knappem call - if(myCash-actualHand->getRiver()->getHighestSet() <= (myCash*1)/4) { - raise = myCash; - myAction = 5; - } - else myAction = 3; - } - // fold - else { - myAction = 1; - } - } - } - else { - // check - if(myOdds < myNiveau[1]) { - myAction = 2; - } - // bet - else { - bet = (((int)myOdds-myNiveau[1])/3)*2*actualHand->getSmallBlind(); - if(bet == 0) { - bet = 2*actualHand->getSmallBlind(); - } - // all in bei nur wenigen Chips - if(myCash/(2*actualHand->getSmallBlind()) <= 6) { - raise = myCash; - } - // all in bei knappem bet - if(bet > (myCash*4.0)/5.0) { - bet = myCash; - } - myAction = 4; - } - - } - - evaluation(bet, raise); - @@ -1644,6 +1710,7 @@ int LocalPlayer::flopCardsValue(int* cards) { } + void LocalPlayer::readFile() { ConfigFile myConfig; diff --git a/src/engine/local_engine/localplayer.h b/src/engine/local_engine/localplayer.h index f4f98a95..3898b21a 100755 --- a/src/engine/local_engine/localplayer.h +++ b/src/engine/local_engine/localplayer.h @@ -105,6 +105,9 @@ public: return sum; } + void setSBluff ( int theValue ) { sBluff = theValue; } + int getSBluff() const { return sBluff; } + void action(); void preflopEngine(); @@ -124,6 +127,7 @@ public: void readFile(); void evaluation(int, int); + private: @@ -159,6 +163,8 @@ private: int myAverageSets[4]; bool myAggressive[7]; + int sBluff; + }; #endif diff --git a/src/engine/local_engine/localriver.cpp b/src/engine/local_engine/localriver.cpp index d1e2e8b7..a17a3290 100755 --- a/src/engine/local_engine/localriver.cpp +++ b/src/engine/local_engine/localriver.cpp @@ -163,6 +163,8 @@ void LocalRiver::postRiverRun() { // 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 << "myAggressive: " << myHand->getPlayerArray()[0]->getMyAggressive() << endl; + // Pot-Verteilung distributePot(); diff --git a/src/engine/playerinterface.h b/src/engine/playerinterface.h index d6207a2a..3030957f 100644 --- a/src/engine/playerinterface.h +++ b/src/engine/playerinterface.h @@ -79,6 +79,9 @@ public: virtual void setMyAggressive(const bool& theValue) =0; virtual int getMyAggressive() const =0; + + virtual void setSBluff ( int theValue ) =0; + virtual int getSBluff() const =0; virtual void action() =0; diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index a4b9ece3..eb67d905 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -819,38 +819,6 @@ Qt::AlignCenter - - - - 95 - 40 - 118 - 111 - - - - - - 9 - 35 - 100 - 40 - - - - - 0 - 20 - - - - - - - Qt::AlignCenter - - - @@ -1065,6 +1033,41 @@ true + + + + 95 + 40 + 118 + 111 + + + + + + 9 + 35 + 100 + 40 + + + + + 0 + 20 + + + + + + + Qt::AlignCenter + + + Qt::NoTextInteraction + + + @@ -1790,22 +1793,6 @@ 185 - - - - 89 - 60 - 90 - 124 - - - - :/guiv2/resources/guiv2/cardholder_03.png - - - true - - @@ -2490,6 +2477,22 @@ + + + + 89 + 60 + 90 + 124 + + + + :/guiv2/resources/guiv2/cardholder_03.png + + + true + + diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 5d6f52bd..a4acbb1e 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -54,7 +54,7 @@ const int maxQuantityPlayersConst = 7; using namespace std; mainWindowImpl::mainWindowImpl(QMainWindow *parent) - : QMainWindow(parent), actualGame(0), actualHand(0), mySession(0), maxQuantityPlayers(maxQuantityPlayersConst), gameSpeed(0), debugMode(0), breakAfterActualHand(FALSE) + : QMainWindow(parent), actualGame(0), actualHand(0), mySession(0), maxQuantityPlayers(maxQuantityPlayersConst), gameSpeed(0), debugMode(1), breakAfterActualHand(FALSE) { int i; @@ -124,6 +124,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent) pixmapLabel_card0a->setObjectName(QString::fromUtf8("pixmapLabel_card0a")); pixmapLabel_card0a->setScaledContents(true); pixmapLabel_card0a->setGeometry(QRect(0, 0, 80, 111)); +// pixmapLabel_card0a->setFocusPolicy(Qt::NoFocus); pixmapLabel_card0b = new MyCardsPixmapLabel(frame_Cards0); pixmapLabel_card0b->setObjectName(QString::fromUtf8("pixmapLabel_card0b")); @@ -2156,10 +2157,15 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { ctrlPressed = TRUE; // QTimer::SingleShot } //CTRL -// if (event->key() == 65) { paintStartSplash(); + if (event->key() == 65) { pixmapLabel_card0a->setUpdatesEnabled(FALSE); } // if (event->key() == 66) { label_logo->hide(); } } +// bool mainWindowImpl::event ( QEvent * event ) { + +// if(event->type() == QEvent::MouseMove) { event->setAccepted ( FALSE ); } +// } + void mainWindowImpl::switchLeftToolBox() { if (groupBox_LeftToolBox->isHidden()) { groupBox_LeftToolBox->show(); } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index ae84ae9b..3587dc90 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -180,6 +180,8 @@ public slots: void breakButtonClicked(); void keyPressEvent ( QKeyEvent*); +// bool event ( QEvent * ); + void switchLeftToolBox(); void switchRightToolBox(); void switchFullscreen(); diff --git a/src/gui/qt/mainwindow/mycardspixmaplabel.cpp b/src/gui/qt/mainwindow/mycardspixmaplabel.cpp index eece80db..78d68e14 100644 --- a/src/gui/qt/mainwindow/mycardspixmaplabel.cpp +++ b/src/gui/qt/mainwindow/mycardspixmaplabel.cpp @@ -65,8 +65,9 @@ void MyCardsPixmapLabel::nextFadeOutFrame() { update(); } else { + fadeOutTimer->stop(); - fadeOutAction = FALSE; +// fadeOutAction = FALSE; } } @@ -177,3 +178,12 @@ void MyCardsPixmapLabel::paintEvent(QPaintEvent * event) { } + +// bool MyCardsPixmapLabel::event ( QEvent * event ) { +// +// if(event->type() == QEvent::MouseMove) { event->ignore(); } +// QLabel::event(event); +// } + + + diff --git a/src/gui/qt/mainwindow/mycardspixmaplabel.h b/src/gui/qt/mainwindow/mycardspixmaplabel.h index e83a952f..02a16059 100644 --- a/src/gui/qt/mainwindow/mycardspixmaplabel.h +++ b/src/gui/qt/mainwindow/mycardspixmaplabel.h @@ -46,6 +46,7 @@ public slots: void nextFadeOutFrame(); void nextFlipCardsFrame(); +// bool event ( QEvent * ); private: