Two step initialization for engine. First step: Create and initialize objects (constructor). Second step: Start the engine, update the UI.

This commit is contained in:
lotodore
2007-05-12 22:00:59 +00:00
parent 7c6337d810
commit 6fbef0af20
15 changed files with 79 additions and 74 deletions
+11 -15
View File
@@ -82,12 +82,6 @@ Game::Game(GuiInterface* gui, const PlayerDataList &playerDataList, const GameDa
playerArray[i] = myFactory->createPlayer(actualBoard, i, uniqueId, type, myName, myAvatarFile, startCash, startQuantityPlayers > i, 0);
}
actualBoard->setPlayer(playerArray);
//// SPIEL-SCHLEIFE
startHand();
// SPIEL-SCHLEIFE
}
@@ -115,7 +109,7 @@ HandInterface * Game::getCurrentHand()
return actualHand;
}
void Game::startHand()
void Game::initHand()
{
int i;
@@ -150,20 +144,22 @@ void Game::startHand()
// Hand erstellen
actualHand = myFactory->createHand(myFactory, myGui, actualBoard, playerArray, actualHandID, startQuantityPlayers, actualQuantityPlayers, dealerPosition, actualSmallBlind, startCash);
//GUI bereinigen
myGui->nextRoundCleanGui();
//Spielernamen schreiben
// myGui->refreshPlayerName();
// Dealer-Button weiterschieben --> Achtung inactive
do {
dealerPosition = (dealerPosition+1)%(MAX_NUMBER_OF_PLAYERS);
} while(!(playerArray[dealerPosition]->getMyActiveStatus()));
// Abfrage Cash==0 -> player inactive -> actualQuantityPlayer--
}
void Game::startHand()
{
assert(actualHand);
//GUI bereinigen
myGui->nextRoundCleanGui();
myGui->logNewGameHandMsg(myGameID, actualHandID);
// Abfrage Cash==0 -> player inactive -> actualQuantityPlayer--
actualHand->start();
}