QApplicationStatus::QApplicationStatus(QObject *parent) : AbstractServiceImplementation(parent), m_statusUri(""), m_statusSocketState(Down), m_connected(false), m_connectionState(Disconnected), m_error(NoError), m_errorString(""), m_running(false), m_synced(false), m_channels(MotionChannel | ConfigChannel | IoChannel | TaskChannel | InterpChannel), m_context(NULL), m_statusSocket(NULL), m_statusHeartbeatTimer(new QTimer(this)) { connect(m_statusHeartbeatTimer, SIGNAL(timeout()), this, SLOT(statusHeartbeatTimerTick())); connect(this, SIGNAL(taskChanged(QJsonObject)), this, SLOT(updateRunning(QJsonObject))); connect(this, SIGNAL(interpChanged(QJsonObject)), this, SLOT(updateRunning(QJsonObject))); initializeObject(MotionChannel); initializeObject(ConfigChannel); initializeObject(IoChannel); initializeObject(TaskChannel); initializeObject(InterpChannel); }
void PluginThread::pluginRunning() { if (getExecutionState() == TES_PAUSED) { updatePaused(false); } else if (getExecutionState() != TES_RUNNING) updateRunning(); }
void PluginThread::run() { bool success = initPlugin(); if (!success) { LOG_ERROR() << "Could not run plugin because plugin creation failed."; return; } //Start plugin updateRunning(); mPlugin->run(); updateFinished(); }
void GameScreen::update(float deltaTime) { for (std::vector<TouchEvent>::iterator itr = m_touchEvents.begin(); itr != m_touchEvents.end(); itr++) { if (m_touchEventsPool.size() < 50) { m_touchEventsPool.push_back(*itr); } } m_touchEvents.clear(); m_touchEvents.swap(m_touchEventsBuffer); m_touchEventsBuffer.clear(); m_backgroundElements->update(deltaTime); switch (m_gameState) { case RUNNING: updateRunning(deltaTime * m_timeButton->getSpeedScalar()); updateInputRunning(); if (World::getInstance()->getScoredEarnedThisFrame() > 0) { addToScore(World::getInstance()->getScoredEarnedThisFrame()); } if (World::getInstance()->getTimesCoreShipModuleHitThisFrame() > 0) { for (int i = 0; i < World::getInstance()->getTimesCoreShipModuleHitThisFrame(); i++) { coreShipModuleHit(); } } break; case PAUSED: updateInputPaused(); break; case GAME_OVER: updateInputGameOver(); break; } }
void GameScreen::update(float deltaTime, std::vector<TouchEvent> &touchEvents) { m_world->update(deltaTime); switch (m_gameState) { case WAITING: updateWaiting(deltaTime); updateInputWaiting(touchEvents); break; case GAME_OVER: updateGameOver(deltaTime); updateInputGameOver(touchEvents); break; case RUNNING: default: m_fTitleAlpha -= deltaTime * 2; updateRunning(deltaTime); updateInputRunning(touchEvents); break; } }