asserts -> LocalExceptions
This commit is contained in:
+19
-11
@@ -1,14 +1,22 @@
|
|||||||
//
|
/***************************************************************************
|
||||||
// C++ Interface: berointerface
|
* Copyright (C) 2006 by FThauer FHammer *
|
||||||
//
|
* f.thauer@web.de *
|
||||||
// Description: Betting rounds interface
|
* *
|
||||||
//
|
* 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 *
|
||||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
//
|
* (at your option) any later version. *
|
||||||
// Copyright: See COPYING file that comes with this distribution
|
* *
|
||||||
//
|
* 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. *
|
||||||
|
***************************************************************************/
|
||||||
#ifndef BEROINTERFACE_H
|
#ifndef BEROINTERFACE_H
|
||||||
#define BEROINTERFACE_H
|
#define BEROINTERFACE_H
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* 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. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef _ENGINE_MSG_H_
|
||||||
|
#define _ENGINE_MSG_H_
|
||||||
|
|
||||||
|
// Engine errors -> LocalExceptions
|
||||||
|
#define ERR_SEAT_NOT_FOUND 10001
|
||||||
|
#define ERR_ACTIVE_PLAYER_NOT_FOUND 10002
|
||||||
|
#define ERR_RUNNING_PLAYER_NOT_FOUND 10003
|
||||||
|
|
||||||
|
#define ERR_NEXT_DEALER_NOT_FOUND 10010
|
||||||
|
#define ERR_NEXT_ACTIVE_PLAYER_NOT_FOUND 10011
|
||||||
|
#define ERR_FORMER_RUNNING_PLAYER_NOT_FOUND 10012
|
||||||
|
|
||||||
|
#define ERR_NO_WINNER 10020
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@@ -1,16 +1,27 @@
|
|||||||
//
|
/***************************************************************************
|
||||||
// C++ Implementation: localbero
|
* Copyright (C) 2006 by FThauer FHammer *
|
||||||
//
|
* f.thauer@web.de *
|
||||||
// Description:
|
* *
|
||||||
//
|
* 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 *
|
||||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
//
|
* (at your option) any later version. *
|
||||||
// Copyright: See COPYING file that comes with this distribution
|
* *
|
||||||
//
|
* 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 "localbero.h"
|
#include "localbero.h"
|
||||||
|
|
||||||
|
#include "localexception.h"
|
||||||
|
#include "engine_msg.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS)
|
LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS)
|
||||||
@@ -28,7 +39,9 @@ LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState g
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(it_c!=myHand->getActivePlayerList()->end());
|
if(it_c == myHand->getActivePlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
// determine smallBlindPosition
|
// determine smallBlindPosition
|
||||||
for(it_c=myHand->getActivePlayerList()->begin(); it_c!=myHand->getActivePlayerList()->end(); it_c++) {
|
for(it_c=myHand->getActivePlayerList()->begin(); it_c!=myHand->getActivePlayerList()->end(); it_c++) {
|
||||||
@@ -37,7 +50,9 @@ LocalBeRo::LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState g
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(it_c!=myHand->getActivePlayerList()->end());
|
if(it_c == myHand->getActivePlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -71,7 +86,9 @@ void LocalBeRo::nextPlayer() {
|
|||||||
// cout << "playerID in nextPlayer(): " << (*currentPlayersTurnIt)->getMyID() << endl;
|
// cout << "playerID in nextPlayer(): " << (*currentPlayersTurnIt)->getMyID() << endl;
|
||||||
|
|
||||||
PlayerListConstIterator currentPlayersTurnConstIt = myHand->getRunningPlayerIt(currentPlayersTurnId);
|
PlayerListConstIterator currentPlayersTurnConstIt = myHand->getRunningPlayerIt(currentPlayersTurnId);
|
||||||
assert( currentPlayersTurnConstIt != myHand->getRunningPlayerList()->end() );
|
if(currentPlayersTurnConstIt == myHand->getRunningPlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
(*currentPlayersTurnConstIt)->action();
|
(*currentPlayersTurnConstIt)->action();
|
||||||
|
|
||||||
@@ -156,11 +173,13 @@ void LocalBeRo::run() {
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
// running player before smallBlind
|
// running player before smallBlind
|
||||||
bool runningPlayerFound = false;
|
bool formerRunningPlayerFound = false;
|
||||||
if(myHand->getActivePlayerList()->size() > 2) {
|
if(myHand->getActivePlayerList()->size() > 2) {
|
||||||
|
|
||||||
it_1 = myHand->getActivePlayerIt(smallBlindPositionId);
|
it_1 = myHand->getActivePlayerIt(smallBlindPositionId);
|
||||||
assert( it_1 != myHand->getActivePlayerList()->end() );
|
if(it_1 == myHand->getActivePlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
for(i=0; i<myHand->getActivePlayerList()->size(); i++) {
|
||||||
|
|
||||||
@@ -171,11 +190,13 @@ void LocalBeRo::run() {
|
|||||||
// running player found
|
// running player found
|
||||||
if(it_2 != myHand->getRunningPlayerList()->end()) {
|
if(it_2 != myHand->getRunningPlayerList()->end()) {
|
||||||
firstRoundLastPlayersTurnId = (*it_2)->getMyUniqueID();
|
firstRoundLastPlayersTurnId = (*it_2)->getMyUniqueID();
|
||||||
runningPlayerFound = true;
|
formerRunningPlayerFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(runningPlayerFound);
|
if(!formerRunningPlayerFound) {
|
||||||
|
throw LocalException(ERR_FORMER_RUNNING_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// heads up: bigBlind begins -> dealer/smallBlind is running player before bigBlind
|
// heads up: bigBlind begins -> dealer/smallBlind is running player before bigBlind
|
||||||
else {
|
else {
|
||||||
@@ -321,7 +342,9 @@ void LocalBeRo::run() {
|
|||||||
|
|
||||||
// determine next running player
|
// determine next running player
|
||||||
PlayerListConstIterator currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
|
PlayerListConstIterator currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
|
||||||
assert( currentPlayersTurnIt != myHand->getRunningPlayerList()->end() );
|
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
currentPlayersTurnIt++;
|
currentPlayersTurnIt++;
|
||||||
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
|
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
|
||||||
@@ -362,7 +385,9 @@ void LocalBeRo::run() {
|
|||||||
// if(myHand->getActivePlayerList()->size() < 3 && (myHand->getPlayerArray()[playersTurn]->getMyID() == dealerPosition || myHand->getPlayerArray()[playersTurn]->getMyID() == smallBlindPosition)) { firstRound = 0; }
|
// if(myHand->getActivePlayerList()->size() < 3 && (myHand->getPlayerArray()[playersTurn]->getMyID() == dealerPosition || myHand->getPlayerArray()[playersTurn]->getMyID() == smallBlindPosition)) { firstRound = 0; }
|
||||||
|
|
||||||
currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
|
currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId );
|
||||||
assert( currentPlayersTurnIt != myHand->getRunningPlayerList()->end() );
|
if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
(*currentPlayersTurnIt)->setMyTurn(true);
|
(*currentPlayersTurnIt)->setMyTurn(true);
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
//
|
/***************************************************************************
|
||||||
// C++ Interface: localbero
|
* Copyright (C) 2006 by FThauer FHammer *
|
||||||
//
|
* f.thauer@web.de *
|
||||||
// Description:
|
* *
|
||||||
//
|
* 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 *
|
||||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
//
|
* (at your option) any later version. *
|
||||||
// Copyright: See COPYING file that comes with this distribution
|
* *
|
||||||
//
|
* 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. *
|
||||||
|
***************************************************************************/
|
||||||
#ifndef LOCALBERO_H
|
#ifndef LOCALBERO_H
|
||||||
#define LOCALBERO_H
|
#define LOCALBERO_H
|
||||||
|
|
||||||
@@ -19,9 +27,6 @@
|
|||||||
#include "berointerface.h"
|
#include "berointerface.h"
|
||||||
#include "handinterface.h"
|
#include "handinterface.h"
|
||||||
|
|
||||||
/**
|
|
||||||
@author FThauer FHammer <webmaster@pokerth.net>
|
|
||||||
*/
|
|
||||||
class LocalBeRo : public BeRoInterface{
|
class LocalBeRo : public BeRoInterface{
|
||||||
public:
|
public:
|
||||||
LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS);
|
LocalBeRo(HandInterface* hi, int id, unsigned dP, int sB, GameState gS);
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "localberopreflop.h"
|
#include "localberopreflop.h"
|
||||||
|
|
||||||
|
#include "localexception.h"
|
||||||
|
#include "engine_msg.h"
|
||||||
|
|
||||||
#include <handinterface.h>
|
#include <handinterface.h>
|
||||||
#include <game_defs.h>
|
#include <game_defs.h>
|
||||||
|
|
||||||
@@ -87,7 +90,9 @@ void LocalBeRoPreflop::run() {
|
|||||||
if(smallBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
if(smallBlindPositionIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||||
|
|
||||||
it = getMyHand()->getActivePlayerIt(getSmallBlindPositionId());
|
it = getMyHand()->getActivePlayerIt(getSmallBlindPositionId());
|
||||||
assert(it != getMyHand()->getActivePlayerList()->end());
|
if(it == getMyHand()->getActivePlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_ACTIVE_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
if(it == getMyHand()->getActivePlayerList()->begin()) it = getMyHand()->getActivePlayerList()->end();
|
if(it == getMyHand()->getActivePlayerList()->begin()) it = getMyHand()->getActivePlayerList()->end();
|
||||||
it--;
|
it--;
|
||||||
@@ -221,7 +226,9 @@ void LocalBeRoPreflop::run() {
|
|||||||
// cout << "currentPlayerID: " << getCurrentPlayersTurnId() << endl;
|
// cout << "currentPlayerID: " << getCurrentPlayersTurnId() << endl;
|
||||||
|
|
||||||
PlayerListConstIterator currentPlayersTurnIt = getMyHand()->getRunningPlayerIt( getCurrentPlayersTurnId() );
|
PlayerListConstIterator currentPlayersTurnIt = getMyHand()->getRunningPlayerIt( getCurrentPlayersTurnId() );
|
||||||
assert( currentPlayersTurnIt != getMyHand()->getRunningPlayerList()->end() );
|
if(currentPlayersTurnIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||||
|
throw LocalException(ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
currentPlayersTurnIt++;
|
currentPlayersTurnIt++;
|
||||||
if(currentPlayersTurnIt == getMyHand()->getRunningPlayerList()->end()) currentPlayersTurnIt = getMyHand()->getRunningPlayerList()->begin();
|
if(currentPlayersTurnIt == getMyHand()->getRunningPlayerList()->end()) currentPlayersTurnIt = getMyHand()->getRunningPlayerList()->begin();
|
||||||
@@ -344,9 +351,11 @@ void LocalBeRoPreflop::run() {
|
|||||||
|
|
||||||
// getMyHand()->getPlayerArray()[getPlayersTurn()]->setMyTurn(1);
|
// getMyHand()->getPlayerArray()[getPlayersTurn()]->setMyTurn(1);
|
||||||
|
|
||||||
currentPlayersTurnConstIt = getMyHand()->getRunningPlayerIt( getCurrentPlayersTurnId() );
|
currentPlayersTurnIt = getMyHand()->getRunningPlayerIt( getCurrentPlayersTurnId() );
|
||||||
assert(currentPlayersTurnConstIt != getMyHand()->getRunningPlayerList()->end());
|
if(currentPlayersTurnIt == getMyHand()->getRunningPlayerList()->end()) {
|
||||||
(*currentPlayersTurnConstIt)->setMyTurn(true);
|
throw LocalException(ERR_RUNNING_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
(*currentPlayersTurnIt)->setMyTurn(true);
|
||||||
|
|
||||||
// (*(getCurrentPlayersTurnIt()))->setMyTurn(true);
|
// (*(getCurrentPlayersTurnIt()))->setMyTurn(true);
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "handinterface.h"
|
#include "handinterface.h"
|
||||||
#include <game_defs.h>
|
#include <game_defs.h>
|
||||||
#include "localexception.h"
|
#include "localexception.h"
|
||||||
|
#include "engine_msg.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -158,7 +159,9 @@ void LocalBoard::distributePot() {
|
|||||||
|
|
||||||
// determine the number of level winners
|
// determine the number of level winners
|
||||||
winnerCount = potLevel.size()-2;
|
winnerCount = potLevel.size()-2;
|
||||||
assert(winnerCount);
|
if (!winnerCount) {
|
||||||
|
throw LocalException(ERR_NO_WINNER);
|
||||||
|
}
|
||||||
|
|
||||||
// distribute the pot level sum to level winners
|
// distribute the pot level sum to level winners
|
||||||
mod = (potLevel[1])%winnerCount;
|
mod = (potLevel[1])%winnerCount;
|
||||||
@@ -170,7 +173,9 @@ void LocalBoard::distributePot() {
|
|||||||
|
|
||||||
for(j=2; j<potLevel.size(); j++) {
|
for(j=2; j<potLevel.size(); j++) {
|
||||||
it = currentHand->getSeatIt(potLevel[j]);
|
it = currentHand->getSeatIt(potLevel[j]);
|
||||||
assert(it != seatsList->end());
|
if(it == seatsList->end()) {
|
||||||
|
throw LocalException(ERR_SEAT_NOT_FOUND);
|
||||||
|
}
|
||||||
(*it)->setMyCash( (*it)->getMyCash() + ((potLevel[1])/winnerCount));
|
(*it)->setMyCash( (*it)->getMyCash() + ((potLevel[1])/winnerCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +210,9 @@ void LocalBoard::distributePot() {
|
|||||||
|
|
||||||
|
|
||||||
it = currentHand->getSeatIt(winnerPointer);
|
it = currentHand->getSeatIt(winnerPointer);
|
||||||
assert(it != seatsList->end());
|
if(it == seatsList->end()) {
|
||||||
|
throw LocalException(ERR_SEAT_NOT_FOUND);
|
||||||
|
}
|
||||||
if(j<mod) {
|
if(j<mod) {
|
||||||
(*it)->setMyCash( (*it)->getMyCash() + (int)((potLevel[1])/winnerCount) + 1);
|
(*it)->setMyCash( (*it)->getMyCash() + (int)((potLevel[1])/winnerCount) + 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -22,6 +22,9 @@
|
|||||||
#include "cardsvalue.h"
|
#include "cardsvalue.h"
|
||||||
#include <game_defs.h>
|
#include <game_defs.h>
|
||||||
|
|
||||||
|
#include "localexception.h"
|
||||||
|
#include "engine_msg.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -377,7 +380,9 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
// DealerButton zuweisen
|
// DealerButton zuweisen
|
||||||
it = getSeatIt(dealerPosition);
|
it = getSeatIt(dealerPosition);
|
||||||
assert(it != seatsList->end() );
|
if(it == seatsList->end()) {
|
||||||
|
throw LocalException(ERR_SEAT_NOT_FOUND);
|
||||||
|
}
|
||||||
(*it)->setMyButton(BUTTON_DEALER);
|
(*it)->setMyButton(BUTTON_DEALER);
|
||||||
|
|
||||||
|
|
||||||
@@ -411,7 +416,9 @@ void LocalHand::assignButtons() {
|
|||||||
// assign big blind next to small blind. ATTENTION: in heads up it is small blind
|
// assign big blind next to small blind. ATTENTION: in heads up it is small blind
|
||||||
bool nextActivePlayerFound = false;
|
bool nextActivePlayerFound = false;
|
||||||
PlayerListIterator dealerPositionIt = getSeatIt(dealerPosition);
|
PlayerListIterator dealerPositionIt = getSeatIt(dealerPosition);
|
||||||
assert( dealerPositionIt != seatsList->end() );
|
if(dealerPositionIt == seatsList->end()) {
|
||||||
|
throw LocalException(ERR_SEAT_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0; i<seatsList->size(); i++) {
|
for(i=0; i<seatsList->size(); i++) {
|
||||||
|
|
||||||
@@ -434,7 +441,9 @@ void LocalHand::assignButtons() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
assert(nextActivePlayerFound);
|
if(!nextActivePlayerFound) {
|
||||||
|
throw LocalException(ERR_NEXT_ACTIVE_PLAYER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
//
|
/***************************************************************************
|
||||||
// C++ Implementation: clientbero
|
* Copyright (C) 2006 by FThauer FHammer *
|
||||||
//
|
* f.thauer@web.de *
|
||||||
// Description:
|
* *
|
||||||
//
|
* 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 *
|
||||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
//
|
* (at your option) any later version. *
|
||||||
// Copyright: See COPYING file that comes with this distribution
|
* *
|
||||||
//
|
* 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 "clientbero.h"
|
#include "clientbero.h"
|
||||||
|
|
||||||
ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, unsigned dP, int sB, GameState gS)
|
ClientBeRo::ClientBeRo(HandInterface* hi, int /*id*/, unsigned dP, int sB, GameState gS)
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
//
|
/***************************************************************************
|
||||||
// C++ Interface: clientbero
|
* Copyright (C) 2006 by FThauer FHammer *
|
||||||
//
|
* f.thauer@web.de *
|
||||||
// Description:
|
* *
|
||||||
//
|
* 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 *
|
||||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
//
|
* (at your option) any later version. *
|
||||||
// Copyright: See COPYING file that comes with this distribution
|
* *
|
||||||
//
|
* 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. *
|
||||||
|
***************************************************************************/
|
||||||
#ifndef CLIENTBERO_H
|
#ifndef CLIENTBERO_H
|
||||||
#define CLIENTBERO_H
|
#define CLIENTBERO_H
|
||||||
|
|
||||||
|
|||||||
+9
-2
@@ -22,6 +22,9 @@
|
|||||||
#include <enginefactory.h>
|
#include <enginefactory.h>
|
||||||
#include <guiinterface.h>
|
#include <guiinterface.h>
|
||||||
|
|
||||||
|
#include "localexception.h"
|
||||||
|
#include "engine_msg.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@@ -199,7 +202,9 @@ void Game::initHand()
|
|||||||
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!!
|
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!!
|
||||||
bool nextDealerFound = false;
|
bool nextDealerFound = false;
|
||||||
PlayerListConstIterator dealerPositionIt = actualHand->getSeatIt(dealerPosition);
|
PlayerListConstIterator dealerPositionIt = actualHand->getSeatIt(dealerPosition);
|
||||||
assert( dealerPositionIt != seatsList->end() );
|
if(dealerPositionIt == seatsList->end()) {
|
||||||
|
throw LocalException(ERR_SEAT_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0; i<seatsList->size(); i++) {
|
for(i=0; i<seatsList->size(); i++) {
|
||||||
|
|
||||||
@@ -214,7 +219,9 @@ void Game::initHand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
assert(nextDealerFound);
|
if(!nextDealerFound) {
|
||||||
|
throw LocalException(ERR_NEXT_DEALER_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user