本文整理汇总了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;
}
}