Erwan
- Reward system in Story mode (currently, either credits or random set) - Rules now accept for player 2 to start (see story mode "block" stage) - Story mode now has an autosave/autoload mechanism. This is for convenience but also to prevent people from abusing the reward mechanism too easily. - possibility to choose an avatar for both players through the rules (see example in story mode)
This commit is contained in:
@@ -73,30 +73,32 @@ Phase * PhaseRing::getCurrentPhase(){
|
||||
return *current;
|
||||
}
|
||||
|
||||
Phase * PhaseRing::forward(){
|
||||
Phase * PhaseRing::forward(bool sendEvents){
|
||||
Phase * cPhaseOld = *current;
|
||||
if (current != ring.end()) current++;
|
||||
if (current == ring.end()) current = ring.begin();
|
||||
|
||||
//Warn the layers about the phase Change
|
||||
WEvent * e = NEW WEventPhaseChange(cPhaseOld, *current);
|
||||
GameObserver::GetInstance()->receiveEvent(e);
|
||||
//delete e;
|
||||
if (sendEvents) {
|
||||
//Warn the layers about the phase Change
|
||||
WEvent * e = NEW WEventPhaseChange(cPhaseOld, *current);
|
||||
GameObserver::GetInstance()->receiveEvent(e);
|
||||
}
|
||||
|
||||
return *current;
|
||||
}
|
||||
|
||||
Phase * PhaseRing::goToPhase(int id, Player * player){
|
||||
Phase * PhaseRing::goToPhase(int id, Player * player, bool sendEvents){
|
||||
Phase * currentPhase = *current;
|
||||
while(currentPhase->id !=id || currentPhase->player != player){ //Dangerous, risk for inifinte loop !
|
||||
#ifdef WIN32
|
||||
OutputDebugString("goto");
|
||||
#endif
|
||||
currentPhase = forward();
|
||||
currentPhase = forward(sendEvents);
|
||||
}
|
||||
return currentPhase;
|
||||
}
|
||||
|
||||
|
||||
int PhaseRing::addPhase(Phase * phase){
|
||||
ring.push_back(phase);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user