Files
pokerth/src/engine/local_engine/localberopostriver.cpp
T

88 lines
3.2 KiB
C++
Raw Normal View History

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;
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()
{
}
void LocalBeRoPostRiver::run() {
}
2007-08-05 13:07:23 +00:00
void LocalBeRoPostRiver::postRiverRun() {
PlayerListConstIterator it_c;
PlayerListIterator it;
2007-08-05 13:07:23 +00:00
// who is the winner
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;
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-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) {
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-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);
// }
// }
// Spieler ermitteln, welche die Karten auf jeden Fall umdrehen müssen
getMyHand()->getBoard()->determinePlayerNeedToShowCards();
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
}