Additional LocalExceptions.
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#define ERR_SEAT_NOT_FOUND 10001
|
#define ERR_SEAT_NOT_FOUND 10001
|
||||||
#define ERR_ACTIVE_PLAYER_NOT_FOUND 10002
|
#define ERR_ACTIVE_PLAYER_NOT_FOUND 10002
|
||||||
#define ERR_RUNNING_PLAYER_NOT_FOUND 10003
|
#define ERR_RUNNING_PLAYER_NOT_FOUND 10003
|
||||||
|
#define ERR_DEALER_NOT_FOUND 10004
|
||||||
|
#define ERR_CURRENT_PLAYER_NOT_FOUND 10005
|
||||||
|
|
||||||
#define ERR_NEXT_DEALER_NOT_FOUND 10010
|
#define ERR_NEXT_DEALER_NOT_FOUND 10010
|
||||||
#define ERR_NEXT_ACTIVE_PLAYER_NOT_FOUND 10011
|
#define ERR_NEXT_ACTIVE_PLAYER_NOT_FOUND 10011
|
||||||
|
|||||||
+4
-4
@@ -66,7 +66,8 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
break;
|
break;
|
||||||
++player_i;
|
++player_i;
|
||||||
}
|
}
|
||||||
assert(player_i != player_end);
|
if (player_i == player_end)
|
||||||
|
throw LocalException(ERR_DEALER_NOT_FOUND);
|
||||||
dealerPosition = startData.startDealerPlayerId;
|
dealerPosition = startData.startDealerPlayerId;
|
||||||
|
|
||||||
// Board erstellen
|
// Board erstellen
|
||||||
@@ -228,8 +229,6 @@ void Game::initHand()
|
|||||||
|
|
||||||
void Game::startHand()
|
void Game::startHand()
|
||||||
{
|
{
|
||||||
assert(actualHand);
|
|
||||||
|
|
||||||
//GUI bereinigen
|
//GUI bereinigen
|
||||||
myGui->nextRoundCleanGui();
|
myGui->nextRoundCleanGui();
|
||||||
|
|
||||||
@@ -260,7 +259,8 @@ boost::shared_ptr<PlayerInterface> Game::getPlayerByUniqueId(unsigned id)
|
|||||||
boost::shared_ptr<PlayerInterface> Game::getCurrentPlayer()
|
boost::shared_ptr<PlayerInterface> Game::getCurrentPlayer()
|
||||||
{
|
{
|
||||||
boost::shared_ptr<PlayerInterface> tmpPlayer = getPlayerByUniqueId(getCurrentHand()->getCurrentBeRo()->getCurrentPlayersTurnId());
|
boost::shared_ptr<PlayerInterface> tmpPlayer = getPlayerByUniqueId(getCurrentHand()->getCurrentBeRo()->getCurrentPlayersTurnId());
|
||||||
assert(tmpPlayer.get());
|
if (!tmpPlayer.get())
|
||||||
|
throw LocalException(ERR_CURRENT_PLAYER_NOT_FOUND);
|
||||||
return tmpPlayer;
|
return tmpPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user