MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / think

Method think

src/Geoscape/GeoscapeState.cpp:539–573  ·  view source on GitHub ↗

* Runs the game timer and handles popups. */

Source from the content-addressed store, hash-verified

537 * Runs the game timer and handles popups.
538 */
539void GeoscapeState::think()
540{
541 State::think();
542
543 _zoomInEffectTimer->think(this, 0);
544 _zoomOutEffectTimer->think(this, 0);
545 _dogfightStartTimer->think(this, 0);
546
547 if (_game->getSavedGame()->getMonthsPassed() == -1)
548 {
549 _game->getSavedGame()->addMonth();
550 determineAlienMissions(true);
551 setupTerrorMission();
552 _game->getSavedGame()->setFunds(_game->getSavedGame()->getFunds() - (_game->getSavedGame()->getBaseMaintenance() - _game->getSavedGame()->getBases()->front()->getPersonnelMaintenance()));
553 }
554 if (_popups.empty() && _dogfights.empty() && (!_zoomInEffectTimer->isRunning() || _zoomInEffectDone) && (!_zoomOutEffectTimer->isRunning() || _zoomOutEffectDone))
555 {
556 // Handle timers
557 _gameTimer->think(this, 0);
558 }
559 else
560 {
561 if (!_dogfights.empty() || _minimizedDogfights != 0)
562 {
563 handleDogfights();
564 }
565 if (!_popups.empty())
566 {
567 // Handle popups
568 _globe->rotateStop();
569 _game->pushState(_popups.front());
570 _popups.erase(_popups.begin());
571 }
572 }
573}
574
575/**
576 * Updates the Geoscape clock with the latest

Callers 3

time5SecondsMethod · 0.45
operator()Method · 0.45
handleDogfightsMethod · 0.45

Calls 12

getMonthsPassedMethod · 0.80
getSavedGameMethod · 0.80
addMonthMethod · 0.80
setFundsMethod · 0.80
getFundsMethod · 0.80
getBaseMaintenanceMethod · 0.80
getBasesMethod · 0.80
isRunningMethod · 0.80
rotateStopMethod · 0.80
pushStateMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected