当前位置: 首页>>代码示例>>C++>>正文


C++ Spell::update方法代码示例

本文整理汇总了C++中Spell::update方法的典型用法代码示例。如果您正苦于以下问题:C++ Spell::update方法的具体用法?C++ Spell::update怎么用?C++ Spell::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Spell的用法示例。


在下文中一共展示了Spell::update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update

void InGameState::update(){
	if(game->getGSM()->getOverlayGameState()!=lastOverlayState){
		map<int,GUIScreenOverlay*>::iterator find=overlayWorkers.find(lastOverlayState);
		if(find!=overlayWorkers.end())(*find).second->onEnd();
		lastOverlayState=game->getGSM()->getOverlayGameState();
		find=overlayWorkers.find(lastOverlayState);
		if(find!=overlayWorkers.end())(*find).second->onStart();
	}
	if(!game->getGSM()->isGameInProgress()){
		int overlayState= game->getGSM()->getOverlayGameState();
		map<int,GUIScreenOverlay*>::iterator find=overlayWorkers.find(overlayState);
		if(find!=overlayWorkers.end())(*find).second->update(game);
		return;
	}

	if(!mainPlayer->wizard->startGameTutorial){
		game->getGSM()->overlayGameState=TUTSYSSCREENOVERLAYNUM;
		tutSys->currentTutorial="StartGame";
		mainPlayer->wizard->startGameTutorial=true;
	}

	/** sort the bots to make rendering more realistic **/
	//Using insertion sort to keep bots in y order. Is poor in high inversion counts. Degrades to 30 FPS at ~608 bodies with test sim.
	//Without sort 650 bodies? depends on the situation. Should be good enough to use.
	InsertionSort(game->getGSM()->getSpriteManager()->getBotList());
	if(gridMapCount--<=0){gridMap.evaluateGrid(game);gridMapCount=120;}


	//GAME OVER HANDLING HERE
	int deadPlayer;
	if((deadPlayer = updatePlayer()) >= 0){

		BattleReportGUI *brg = new BattleReportGUI();			

		if(deadPlayer == 0){
			//DISPLAY LOSS
			brg->onStart(game, false);
			overlayWorkers[GS_GAME_OVER] = brg;
			game->getSoundManager()->stopCue("MAIN_LOOP");
			game->getSoundManager()->playCue("VICTORY");
			game->getGSM()->gameOver();
		}else{
			//DISPLAY VICTORY
			brg->onStart(game, true);
			overlayWorkers[GS_VICTORY] = brg;
			game->getSoundManager()->stopCue("MAIN_LOOP");
			game->getSoundManager()->playCue("VICTORY");
			game->getGSM()->victory();
		}
	}



	list<Spell*>::iterator spellIt= spells.begin();
	while(spellIt!=spells.end()){
		Spell* spell = *spellIt;
		if(spell->update(game)){
			spellIt=spells.erase(spellIt);
			delete spell;
		}
		else
			spellIt++;
	}
	if(count++>100 && !players[0]->tower->isDead()&& !players[1]->tower->isDead()){
		BotRecycler* recycler=game->getGSM()->getSpriteManager()->getBotRecycler();
		Unit* u;


		count=0;
	}
}
开发者ID:ChuckNice,项目名称:SBU_Sources,代码行数:71,代码来源:InGameState.cpp


注:本文中的Spell::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。