2011-07-03 22:27:36 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* PokerTH - The open source texas holdem engine *
|
|
|
|
|
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
2007-08-05 13:07:23 +00:00
|
|
|
#include "localberopostriver.h"
|
|
|
|
|
#include <handinterface.h>
|
|
|
|
|
#include <game_defs.h>
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
2007-09-24 10:02:17 +00:00
|
|
|
LocalBeRoPostRiver::LocalBeRoPostRiver(HandInterface* hi, int id, int dP, int sB) : LocalBeRo(hi, id, dP, sB, GAME_STATE_POST_RIVER), highestCardsValue(0)
|
2007-08-05 13:07:23 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LocalBeRoPostRiver::~LocalBeRoPostRiver()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
void LocalBeRoPostRiver::run()
|
|
|
|
|
{
|
2007-08-22 23:00:51 +00:00
|
|
|
}
|
2007-08-05 13:07:23 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
void LocalBeRoPostRiver::postRiverRun()
|
|
|
|
|
{
|
2007-10-19 14:03:12 +00:00
|
|
|
|
2007-09-27 18:07:03 +00:00
|
|
|
PlayerListConstIterator it_c;
|
|
|
|
|
PlayerListIterator it;
|
2007-08-05 13:07:23 +00:00
|
|
|
|
2007-10-19 14:03:12 +00:00
|
|
|
// who is the winner
|
2011-02-09 14:33:39 +00:00
|
|
|
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
|
2007-09-27 18:07:03 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() > highestCardsValue ) {
|
|
|
|
|
highestCardsValue = (*it_c)->getMyCardsValueInt();
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int potPlayers = 0;
|
2007-09-27 18:07:03 +00:00
|
|
|
|
2011-02-09 14:33:39 +00:00
|
|
|
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
|
2007-09-27 18:07:03 +00:00
|
|
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
|
2007-08-05 13:07:23 +00:00
|
|
|
potPlayers++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-11-12 22:11:16 +00:00
|
|
|
// prüfen ob nur noch human player an der verteilung teilnimmt und myAggressive für human player setzen
|
|
|
|
|
if(potPlayers == 1) {
|
2011-02-09 14:33:39 +00:00
|
|
|
for(it=getMyHand()->getActivePlayerList()->begin(); it!=getMyHand()->getActivePlayerList()->end(); ++it) {
|
2007-11-12 22:11:16 +00:00
|
|
|
if( (*it)->getMyAction() != PLAYER_ACTION_FOLD) {
|
|
|
|
|
(*it)->setMyAggressive(true);
|
|
|
|
|
}
|
2007-09-27 18:07:03 +00:00
|
|
|
}
|
|
|
|
|
}
|
2007-08-05 13:07:23 +00:00
|
|
|
|
2007-11-12 22:11:16 +00:00
|
|
|
// it = getMyHand()->getActivePlayerIt(0);
|
|
|
|
|
// if( it != getMyHand()->getActivePlayerList()->end() ) {
|
|
|
|
|
// if( potPlayers == 1 && (*it)->getMyAction() != PLAYER_ACTION_FOLD ) {
|
|
|
|
|
// (*it)->setMyAggressive(true);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
2010-07-23 15:55:52 +00:00
|
|
|
// Spieler ermitteln, welche die Karten auf jeden Fall umdrehen müssen
|
|
|
|
|
getMyHand()->getBoard()->determinePlayerNeedToShowCards();
|
2010-07-22 06:03:11 +00:00
|
|
|
|
2007-08-05 13:07:23 +00:00
|
|
|
// Pot-Verteilung
|
2007-08-10 18:44:41 +00:00
|
|
|
getMyHand()->getBoard()->distributePot();
|
2007-08-05 13:07:23 +00:00
|
|
|
|
|
|
|
|
//Pot auf 0 setzen
|
2007-08-07 23:59:34 +00:00
|
|
|
getMyHand()->getBoard()->setPot(0);
|
2010-07-23 15:55:52 +00:00
|
|
|
|
2007-08-05 13:07:23 +00:00
|
|
|
//starte die Animaionsreihe
|
2011-02-11 20:02:08 +00:00
|
|
|
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|