- Send an event when Phase changes
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-06-16 14:10:33 +00:00
parent 96963fc5ac
commit 7804cbbd64
3 changed files with 22 additions and 0 deletions

View File

@@ -80,8 +80,15 @@ void GameObserver::nextPlayer(){
}
void GameObserver::nextGamePhase(){
Phase * cPhaseOld = phaseRing->getCurrentPhase();
phaseRing->forward();
Phase * cPhase = phaseRing->getCurrentPhase();
//Warn the layers about the phase Change
WEvent * e = NEW WEventPhaseChange(cPhaseOld, cPhase);
receiveEvent(e);
delete e;
currentGamePhase = cPhase->id;
if (currentPlayer != cPhase->player) nextPlayer();