这篇教程C++ ChangeState函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ChangeState函数的典型用法代码示例。如果您正苦于以下问题:C++ ChangeState函数的具体用法?C++ ChangeState怎么用?C++ ChangeState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ChangeState函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetAccountFromSender void AccountActionsManager::handleChangeStatusRequested () { auto action = qobject_cast<QAction*> (sender ()); const auto acc = GetAccountFromSender (sender (), Q_FUNC_INFO); QVariant stateVar = action->property ("Azoth/TargetState"); EntryStatus status; if (!stateVar.isNull ()) { const auto state = stateVar.value<State> (); status = EntryStatus (state, GetStatusText (action, state)); } else { SetStatusDialog ssd (acc->GetAccountID ()); if (ssd.exec () != QDialog::Accepted) return; status = EntryStatus (ssd.GetState (), ssd.GetStatusText ()); } acc->ChangeState (status); }
开发者ID:ForNeVeR,项目名称:leechcraft,代码行数:23,
示例2: ChangeStatevoid Engine::Update(){ DeltaTime = m_DeltaTimer.restart(); TotalDeltaTime += DeltaTime; if(m_QueuedState != nullptr) ChangeState(); while(m_DisplayWindow.pollEvent(EventHandle)) { if(EventHandle.type == sf::Event::KeyPressed && EventHandle.key.code == sf::Keyboard::Return && EventHandle.key.alt) { VID_FLAGS ^= sf::Style::Fullscreen; m_DisplayWindow.create(sf::VideoMode(RESOLUTION.x, RESOLUTION.y), WINDOW_TITLE, VID_FLAGS); } if (EventHandle.type == sf::Event::Closed) Quit(); } if(m_CurrentState != nullptr) m_CurrentState->Update(DeltaTime);}
开发者ID:DafuqStudios,项目名称:Life-In-Hjarnarp,代码行数:23,
示例3: __ASSERT_DEBUGvoid CBTHidConnection::OfferControlSocket(const TBTDevAddr& aAddress, RSocket*& aSocket) { TRACE_FUNC (_L("[BTHID]/tCBTHidConnection::OfferControlSocket")); if (aAddress == iDevice->iAddress) { __ASSERT_DEBUG((iConnectionState == ELinkLost) || (iConnectionState == EHIDInitConnecting) || (iConnectionState == EHIDReconnecting), User::Panic(KPanicBTConnection, ESocketsBadState)); // Take ownership of this socket delete iControlSocket; iControlSocket = aSocket; aSocket = 0; // Mark that the HID Device is reconnecting to us. Skip the state change if an initial connection from HID device. if (iConnectionState != EHIDInitConnecting) { ChangeState(EHIDReconnecting); } } }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:23,
示例4: SetDragStatevoid TCompGuiDrag::Over(){ if (checkEnabled()) { if (checkOver()) { if (controller->IsGuiItemDragged()) { SetDragState(Clicked); } else render_state = RSTATE_OVER; if (controller->IsLeftPressed()) { SetValue(value - 0.1f); notifyValue(); } else if (controller->IsRightPressed()) { SetValue(value + 0.1f); notifyValue(); } } else { ChangeState(STRING(Enabled)); notifyOver(false); } }}
开发者ID:DopaminaInTheVein,项目名称:ItLightens,代码行数:23,
示例5: ChangeStatevoid MyWorld::TakenTurn(){ TurnsLeft--; if (TurnsLeft < 0) { // Play end of round music Audio::PlayMusic("game_over.mp3", false); // Game over ChangeState(eGameState_GameOver); } else TurnsLeftChanged = true; if (HasWon()) { // Play end of round music Audio::PlayMusic("end_round.mp3", false); // Next round NextRound(); }}
开发者ID:AbrahamKO,项目名称:gbsgamejam,代码行数:23,
示例6: ifvoid CAICoreEvent::Update(float _fTime){ if( !m_pCurrState ) return; if( m_pCurrState->Update(_fTime) ) { IAIState* pNewState = nullptr; if( m_pCurrState == &m_cLaserPhase ) { m_pTower->SetShieldActive(false); pNewState = &m_cTurretPhase; } else if( m_pCurrState == &m_cTurretPhase ) pNewState = &m_cCoreFight; if( pNewState ) ChangeState(pNewState); else CGame::GetInstance()->GetOF()->StopEvent(this); }}
开发者ID:ianalcid08,项目名称:FinalProject,代码行数:23,
示例7: ChangeStatevoid PhoenixEngine::ToggleLoading(bool bToggle){ sf::Context Cont; if(m_LoadingState != nullptr) { if(bToggle) { bLoading = true; m_QueuedState = m_LoadingState; ChangeState(); m_DisplayWindow.setActive(false); //Give thread access to window context sf::sleep(sf::milliseconds(100)); m_AsyncThread.launch(); } else { bLoading = false; m_AsyncThread.wait(); sf::sleep(sf::milliseconds(100)); m_DisplayWindow.setActive(true); } }}
开发者ID:MasterKenth,项目名称:Mugito,代码行数:23,
示例8: AddStatevoid CThrowBomb::onCreate(const TMsgEntityCreated& msg) { if (statemap.empty()) { //Specific Bomb nodes AddState("born", (statehandler)&CThrowBomb::Born); AddState("idle", (statehandler)&CThrowBomb::Idle); AddState("throwing", (statehandler)&CThrowBomb::Throwing); AddState("throwed", (statehandler)&CThrowBomb::Throwed); AddState("impacted", (statehandler)&CThrowBomb::Impacted); AddState("explode", (statehandler)&CThrowBomb::Explode); AddState("dead", (statehandler)&CThrowBomb::Dead); } ____TIMER_REDEFINE_(t_explode, 2.5f); ChangeState("born");#ifdef CALIBRATE_GAME if (calibrate) { lmax = lmax_st; hmax = hmax_st; speed = speed_st; t_explode = timer_st; rad_squared = powf(radius_st, 2.f); }#endif}
开发者ID:DopaminaInTheVein,项目名称:ItLightens,代码行数:23,
示例9: ifvoid TodoList::on_confirmButton_clicked(){ QString name = ui->nameBox->text(); if(name.size() == 0){ warnAniTime = 30; return; } TodoItem item; item.SetName(name.toStdString()); item.SetPlace(ui->placeBox->text().toStdString()); item.SetContent(ui->contentBox->toPlainText().toStdString()); item.SetLabel(ui->labelBox->text().toStdString()); item.SetKind(ui->comboBox->currentIndex()); QDateTime dateTime = ui->dateTimeEdit->dateTime(); QDate date = dateTime.date(); QTime ti = dateTime.time(); item.SetTime(Date(date.year(),date.month(),date.day(),ti.hour(),ti.minute())); item.SetWarnTime(ui->horizontalSlider->value() * 5); //以分为单位 int level = 0; if (ui->radioButton_1->isChecked()) level = 3; if (ui->radioButton_2->isChecked()) level = 1; if (ui->radioButton_3->isChecked()) level = 2; if (ui->radioButton_4->isChecked()) level = 0; item.SetLevel(level); if(state == WINSTATE::EDIT){ pa.AddTodo(item); }else if(state == WINSTATE::DETAIL){ pa.ChangeTodo(item,selectID,viewDate.year,viewDate.month); } ChangeState(WINSTATE::LIST);}
开发者ID:wkcn,项目名称:TodoList,代码行数:37,
示例10: newPlaygroup/** * /brief determine initial tv state and playgroup for the recording * /param islivetv: true if recording is livetv */void PlayerContext::SetInitialTVState(bool islivetv){ TVState newState = kState_None; QString newPlaygroup("Default"); LockPlayingInfo(__FILE__, __LINE__); if (islivetv) { SetTVChain(new LiveTVChain()); newState = kState_WatchingLiveTV; } else if (playingInfo) { int overrecordseconds = gCoreContext->GetNumSetting("RecordOverTime"); QDateTime curtime = MythDate::current(); QDateTime recendts = playingInfo->GetRecordingEndTime() .addSecs(overrecordseconds); if (playingInfo->IsRecording()) { newState = (curtime < recendts) ? kState_WatchingRecording : kState_WatchingPreRecorded; } else if (playingInfo->IsVideoDVD()) newState = kState_WatchingDVD; else if (playingInfo->IsVideoBD()) newState = kState_WatchingBD; else newState = kState_WatchingVideo; newPlaygroup = playingInfo->GetPlaybackGroup(); } UnlockPlayingInfo(__FILE__, __LINE__); ChangeState(newState); SetPlayGroup(newPlaygroup);}
开发者ID:aravilife,项目名称:mythtv-stabilize2,代码行数:41,
示例11: SetupZillaintSetupZilla(short SpriteNum){ SPRITEp sp = &sprite[SpriteNum]; USERp u; ANIMATOR DoActorDecide; if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE)) { u = User[SpriteNum]; ASSERT(u); } else { User[SpriteNum] = u = SpawnUser(SpriteNum,ZILLA_RUN_R0,s_ZillaRun[0]); u->Health = 6000; } if (Skill == 0) u->Health = 2000; if (Skill == 1) u->Health = 4000; ChangeState(SpriteNum,s_ZillaRun[0]); u->Attrib = &ZillaAttrib; DoActorSetSpeed(SpriteNum, NORM_SPEED); u->StateEnd = s_ZillaDie; u->Rot = sg_ZillaRun; EnemyDefaults(SpriteNum, &ZillaActionSet, &ZillaPersonality); sp->clipdist = (512) >> 2; sp->xrepeat = 97; sp->yrepeat = 79; //SET(u->Flags, SPR_XFLIP_TOGGLE); return 0;}
开发者ID:SilkyPantsDan,项目名称:eduke32,代码行数:37,
示例12: ChangeState//*********************************************************************//// Terminate// - exit the current state// - terminate the SGD wrappersvoid Game::Terminate( void ){ // Exit the current state ChangeState( nullptr ); // Terminate & Deallocate the font if( m_pFont != nullptr ) { m_pFont->Terminate(); delete m_pFont; } SGD::GraphicsManager::GetInstance()->UnloadTexture(m_hMainMenuBackground); SGD::GraphicsManager::GetInstance()->UnloadTexture(m_hPlayerImg); SGD::GraphicsManager::GetInstance()->UnloadTexture(m_hEnemyImg); // unloads audio SGD::AudioManager::GetInstance()->UnloadAudio(m_hProjectileSecSfx); SGD::AudioManager::GetInstance()->UnloadAudio(m_hBackgroundMus); SGD::AudioManager::GetInstance()->UnloadAudio(m_hEnemyHitSfx); SGD::AudioManager::GetInstance()->UnloadAudio(m_hGameOverSfx); SGD::AudioManager::GetInstance()->UnloadAudio(m_hGameWinSfx); SGD::AudioManager::GetInstance()->UnloadAudio(m_hMenuChangeSfx); // Terminate the SGD wrappers (in reverse order) SGD::AudioManager::GetInstance()->Terminate(); SGD::AudioManager::DeleteInstance(); SGD::InputManager::GetInstance()->Terminate(); SGD::InputManager::DeleteInstance(); SGD::GraphicsManager::GetInstance()->Terminate(); SGD::GraphicsManager::DeleteInstance();}
开发者ID:evalottaw,项目名称:StardustCrusader,代码行数:40,
示例13: ChangeStatevoid MyCharacter::OnEvent(const irr::SEvent & e){ //键盘事件 if (e.EventType == EET_KEY_INPUT_EVENT) { if ( //按X 切换 站立 攻击准备模式 if (e.KeyInput.Key == KEY_KEY_X && e.KeyInput.PressedDown==false) { ChangeState(); } //按R 切换跑步走路 模式 if (e.KeyInput.Key == KEY_KEY_R && e.KeyInput.PressedDown==false) { ChangeRunMode(); } //按空格,捡物品 if (e.KeyInput.Key == KEY_SPACE && e.KeyInput.PressedDown==false) { CollectDropItem(); } //按Q 使用包裹里的MP恢复药 if (e.KeyInput.Key == KEY_KEY_Q && e.KeyInput.PressedDown==false) { //请求使用装备包裹里的消耗品 property.cmd=CMD_C2S_Request_UsePackageHPItem; cnet->SendMsg((char*)&property,sizeof(RoleProperty)); } } }
开发者ID:zhouyige,项目名称:3drpgdemo,代码行数:36,
示例14: ELOG1void CMMAVideoPlayer::CompletePrefetch(TInt aError){ ELOG1(EJavaMMAPI, "CMMAVideoPlayer::CompletePrefetch + error = %d",aError); // Post KNotCompleteVideoError as KErrNone to the Java side, because // video can be played. if (aError == KNotCompleteVideoError) { LOG(EJavaMMAPI, EInfo, "CMMAVideoPlayer::CompletePrefetch KNotCompleteVideoError "); // release java PostActionCompleted(KErrNone); } else { LOG(EJavaMMAPI, EInfo, "CMMAVideoPlayer::CompletePrefetch CompleteVideoError "); // release java PostActionCompleted(aError); } if (aError == KErrNone || aError == KNotCompleteVideoError) { ChangeState(EPrefetched); } LOG(EJavaMMAPI, EInfo, "CMMAVideoPlayer::CompletePrefetch - ");}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:24,
|