asserts -> LocalExceptions

This commit is contained in:
floty
2007-10-14 11:01:44 +00:00
parent e54242b711
commit 7f07d066aa
11 changed files with 202 additions and 81 deletions
+9 -2
View File
@@ -22,6 +22,9 @@
#include <enginefactory.h>
#include <guiinterface.h>
#include "localexception.h"
#include "engine_msg.h"
#include <iostream>
#include <sstream>
@@ -199,7 +202,9 @@ void Game::initHand()
// Dealer-Button weiterschieben --> Achtung inactive -> TODO exception-rule !!!
bool nextDealerFound = false;
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++) {
@@ -214,7 +219,9 @@ void Game::initHand()
}
}
assert(nextDealerFound);
if(!nextDealerFound) {
throw LocalException(ERR_NEXT_DEALER_NOT_FOUND);
}
}