예제 #1
0
Wizard::Wizard(QWidget *a_parent, const char *a_name, bool a_modal, int a_flags)
  : QWizard(a_parent, a_name, a_modal, a_flags), KommanderWidget(this)
{
  QStringList states;
  states << "default";
  states << "initialization";
  states << "destroy";
  setStates(states);
  setDisplayStates(states);

  connect(this, SIGNAL(helpClicked()), SLOT(runHelp()));
}
예제 #2
0
void StateMachine::run() {
	ResourceManager& resourceManager = ResourceManager::getInstance();
	if (!resourceManager.noUsableScreenResolution) {
		state = loading; //Edit this to set the startup state
	}
	else {
		state = noScreenResolution; //Edit this to set the startup state
	}
	sf::Sound sound;
	while (state != quit) {
		switch (state) {
		case loading:
			state = runLoading();
			break;
		case mainMenu:
			sound.SetBuffer(resourceManager.sounds.getSound(0,"ChangeState"));
			sound.Play();
			state = runMainMenu();
			break;
		case gameSetup:
			sound.SetBuffer(resourceManager.sounds.getSound(0,"ChangeState"));
			sound.Play();
			state = runGameSetup();
			break;
		case runGame:
			state = runTheGame();			
			break;
		case gameDone:
			state = runGameDone();
			break;
		case highScore:
			sound.SetBuffer(resourceManager.sounds.getSound(0,"ChangeState"));
			sound.Play();
			state = runHighScore();
			break;
		case credits:
			sound.SetBuffer(resourceManager.sounds.getSound(0,"ChangeState"));
			sound.Play();
			state = runCredits();
			break;
		case help:
			sound.SetBuffer(resourceManager.sounds.getSound(0,"ChangeState"));
			sound.Play();
			state = runHelp();
			break;
		case noScreenResolution:
			state = runNoScreenResolution();
			state = quit;
			break;
		case tournament:
			state = runTournament();
		default:
			break;
		}
		// Just in case something in the list is bad pointers.
		// TODO: Clean up all resources in the end of all
		// state functions (like runTheGame)
		resourceManager.drawableList.clear();
	}
	resourceManager.win.Close();
}