2007-08-05 13:07:23 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2006 by FThauer FHammer *
|
|
|
|
|
* f.thauer@web.de *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation; either version 2 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 General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
#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()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-22 23:00:51 +00:00
|
|
|
void LocalBeRoPostRiver::run() {
|
|
|
|
|
}
|
2007-08-05 13:07:23 +00:00
|
|
|
|
2007-08-22 20:49:07 +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
|
2007-09-27 18:07:03 +00:00
|
|
|
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();
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int potPlayers = 0;
|
2007-09-27 18:07:03 +00:00
|
|
|
|
|
|
|
|
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
|
|
|
|
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
|
2007-08-05 13:07:23 +00:00
|
|
|
potPlayers++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-27 18:07:03 +00:00
|
|
|
// 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
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);
|
2007-08-05 13:07:23 +00:00
|
|
|
|
|
|
|
|
//starte die Animaionsreihe
|
2007-08-07 23:59:34 +00:00
|
|
|
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
|
2007-08-05 13:07:23 +00:00
|
|
|
}
|