这篇教程C++ Break函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Break函数的典型用法代码示例。如果您正苦于以下问题:C++ Break函数的具体用法?C++ Break怎么用?C++ Break使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Break函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Breakvoid CBreakableObject::CheckHitBreak(float power,ALife::EHitType hit_type){ if( hit_type!=ALife::eHitTypeStrike) { float res_power=power*m_immunity_factor; if(power>m_health_threshhold) fHealth-=res_power; } if(fHealth<=0.f) { Break();return; } if(hit_type==ALife::eHitTypeStrike)Break();}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:14,
示例2: movevoid move(int direction, int speed, int distance, int FBbreakspd){ revolutions = 360*(distance/wheelCircumference); switch (direction) { case forward: zeroEncoders(); while(getDTEncoderAverage() < revolutions){ setDriveMotors(127,127,127, 127); setFBMotors(FBbreakspd); } zeroEncoders(); Break(forward); break; case turnLeft: //int FLSpeed, int FRspeed, int BRspeed, int BLspeed zeroEncoders(); while(getDTEncoderAverage() < revolutions){ setDriveMotors(-127, 127, 127, -127); setFBMotors(FBbreakspd); } Break(turnLeft); break; case turnRight: //int FLSpeed, int FRspeed, int BRspeed, int BLspeed zeroEncoders(); while(getDTEncoderAverage() < revolutions){ setDriveMotors(127, -127, -127, 127); setFBMotors(FBbreakspd); } Break(turnRight); break; case backwards: zeroEncoders(); while(getDTEncoderAverage() < revolutions){ setDriveMotors(-127, -127, -127, -127); setFBMotors(FBbreakspd); } Break(backwards); break; default: setDriveMotors(0,0,0,0); zeroEncoders(); } zeroEncoders();}
开发者ID:wa-robotics,项目名称:starstruck-2016,代码行数:50,
示例3: shutdownvoid ofxOscReceiver::setup( int listen_port ){ if( osc::UdpSocket::GetUdpBufferSize() == 0 ){ osc::UdpSocket::SetUdpBufferSize(65535); } // if we're already running, shutdown before running again if ( listen_socket ){ shutdown(); } // create socket auto socket = new osc::UdpListeningReceiveSocket( osc::IpEndpointName( osc::IpEndpointName::ANY_ADDRESS, listen_port ), this, allowReuse ); auto deleter = [](osc::UdpListeningReceiveSocket*socket){ // tell the socket to shutdown socket->Break(); delete socket; }; auto new_ptr = std::unique_ptr<osc::UdpListeningReceiveSocket, decltype(deleter)>(socket, deleter); listen_socket = std::move(new_ptr); listen_thread = std::thread([this]{ listen_socket->Run(); }); // detach thread so we don't have to wait on it before creating a new socket // or on destruction, the custom deleter for the socket unique_ptr already // does the right thing listen_thread.detach(); this->listen_port = listen_port;}
开发者ID:AbdelghaniDr,项目名称:openFrameworks,代码行数:32,
示例4: FCPausevoid FCPause( void ) {//=======================// Process PAUSE statement. Break( RT_PAUSE );}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:7,
示例5: FCStopvoid FCStop( void ) {//======================// Process STOP statement. Break( RT_STOP );}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:7,
示例6: GetOwner// get user options, process and save.voidOptions::onbtnSave(){ int dontsplash = optSplash.Get(); // get the value from option control int savewinpos = optSaveWinPos.Get();// get the value from option control Ctrl* owner = GetOwner(); // get a handle to the Options dislog owner which is MyUppApp main window. Rect rc; // create a struct to store window position and size if ( savewinpos != 1 ) { // if Save Window option is not checked. rc.left = 0; // set window position x to 0 rc.top = 0; // set window position y to 0 } else { rc = owner->GetRect(); // get the position and size of MyUppApp main window } String cfg; // create a string to store config data cfg << "Splash=" << dontsplash << "/n" // save user's choice "SaveWinPos=" << savewinpos << "/n" // save user's choice "PosX=" << rc.left << "/n" // save window x position "PosY=" << rc.top << "/n"; // save window y position if( !SaveFile(cfgfile, cfg) ) // save the config file Exclamation("Error saving configuration!"); // if failed show error dialog else PromptOK("Options saved!"); // show success dialog Break(IDOK); // close this dialog}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:30,
示例7: getPlayerPedvoid CObject::Explode(){ CVector pos = Placeable.GetPos(); pos.z += 0.5; CExplosion::AddExplosion(this, getPlayerPed(-1), 9, pos, 100, 1, -1.0, 0); if(m_colDamageEffect == 0xCA || m_colDamageEffect == 0xc8) { pos.z -= 1.0; Break(10000.0, pos, 0, getPlayerPed(-1), 51); } else if(!bDisableFriction) { m_vecLinearVelocity.z += 0.5; m_vecLinearVelocity.x += (rand() - 128) * 0.000199999994947575; m_vecLinearVelocity.y += (rand() - 128) * 0.000199999994947575; if(bIsStatic || bIsStaticWaitingForCollision) { SetIsStatic(false); AddToMovingList(); } } if(m_pObjectInfo->fxType == 2) { CMatrix pos = CMatrix::FromXYZ(m_xyz); // to object space CVector fx_obj_pos = pos * m_pObjectInfo->fxOffset; fx_obj_pos += GetPos(); // to world space FxSystem_c *sys = FxManager.InitialiseFxSystem(m_pObjectInfo->pFxSystemBP, fx_obj_pos, 0, 0); if(sys) { sys->Start(); } }}
开发者ID:ArnCarveris,项目名称:GTASA,代码行数:34,
示例8: sizeof/*================idBrittleFracture::Shatter================*/void idBrittleFracture::Shatter( const idVec3 &point, const idVec3 &impulse, const int time ) { int i; idVec3 dir; shard_t *shard; float m; if ( gameLocal.isServer ) { idBitMsg msg; byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); msg.BeginWriting(); msg.WriteFloat( point[0] ); msg.WriteFloat( point[1] ); msg.WriteFloat( point[2] ); msg.WriteFloat( impulse[0] ); msg.WriteFloat( impulse[1] ); msg.WriteFloat( impulse[2] ); ServerSendEvent( EVENT_SHATTER, &msg, true, -1 ); } if ( time > ( gameLocal.time - SHARD_ALIVE_TIME ) ) { StartSound( "snd_shatter", SND_CHANNEL_ANY, 0, false, NULL ); } if ( !IsBroken() ) { Break(); } if ( fxFracture.Length() ) { idEntityFx::StartFx( fxFracture, &point, &GetPhysics()->GetAxis(), this, true ); } dir = impulse; m = dir.Normalize(); for ( i = 0; i < shards.Num(); i++ ) { shard = shards[i]; if ( shard->droppedTime != -1 ) { continue; } if ( ( shard->clipModel->GetOrigin() - point ).LengthSqr() > Square( maxShatterRadius ) ) { continue; } DropShard( shard, point, dir, m, time ); } DropFloatingIslands( point, impulse, time ); //trigger it. if (!firedTargets) { firedTargets = true; ActivateTargets(this); }}
开发者ID:tankorsmash,项目名称:quadcow,代码行数:64,
示例9: Breakbool TopWindow::AcceptBreak(int ID){ if(Accept()) { Break(ID); return true; } return false;}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:8,
示例10: Break/*================idBrittleFracture::Event_Activate================*/void idBrittleFracture::Event_Activate( idEntity* activator ){ disableFracture = false; if( health <= 0 ) { Break(); }}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:13,
示例11: Breakvoid DbgGdb::SetBreakpoints(){ for ( size_t i=0; i< m_bpList.size(); i++ ) { // Without the 'unnecessary' cast in the next line, bpinfo.bp_type is seen as (e.g.) 4 instead of BP_type_tempbreak, ruining switch statments :/ BreakpointInfo bpinfo = ( BreakpointInfo )m_bpList.at( i ); Break( bpinfo ); }}
开发者ID:LoviPanda,项目名称:codelite,代码行数:8,
示例12: ActivateTargets/*================idBrittleFracture::Killed================*/void idBrittleFracture::Killed( idEntity* inflictor, idEntity* attacker, int damage, const idVec3& dir, int location ){ if( !disableFracture ) { ActivateTargets( this ); Break(); }}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:13,
示例13: Break//-----------------------------------------------------------------------------// Purpose: Take damage will break the rope//-----------------------------------------------------------------------------int CRopeKeyframe::OnTakeDamage( const CTakeDamageInfo &info ){ // Only allow this if it's been marked if( !(m_RopeFlags & ROPE_BREAKABLE) ) return false; Break(); return 0;}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:12,
示例14: Addvoid CLogger::Error(char* szText){ Add("ERROR", szText); if (msConfig.bBreakOnError) { Break(); }}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:9,
示例15: Breakvoid cyclic::Click(){ for(int i=0;i<16;i++) { dc[i]=cols[i].GetData(); } par.change(colnum, dc); Break(IDOK);}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:9,
示例16: GetPdfConfigPath/////////////////////////////////////////////////////////////////////////////////////// create handlervoid TPdfFrontend::onCreate(void){ FileSel fs; // if no documents, just do nothing if(!Documents.GetCount()) return; // first, gets last browsed path (if any) String cfgPath = GetPdfConfigPath() + "lastpath"; if(FileExists(cfgPath)) { FileIn f(cfgPath); fs.Set(f.GetLine()); } // gets the output file name, returns if cancelled fs.DefaultExt(".pdf").Type("documenti pdf", "*.pdf"); if(!fs.ExecuteSaveAs("Nome del documento pdf:")) return; // stores last active output path RealizeDirectory(GetPdfConfigPath()); FileOut f(cfgPath); f.PutLine(fs.Get()); // creates the command line and executes ghostscript String FileName = fs.Get(); String args = "-q -dBATCH -dAutoFilterColorImages=false -sColorImageFilter=FlateEncode -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=/"" + FileName + "/" /"" + Documents[0] + "/""; for(int i = 1 ; i < Documents.GetCount(); i++) args = args + " /"" + Documents[i] + "/""; String OutStr, ErrStr; bool res = SysExec("gs", args, Environment(), OutStr, ErrStr); // creates progress bar and hooks inside client// Progress progress("Creazione pdf in corso....");// Client.setProgress(progress);// progress.Create(); // Client.setProgress(0);// if(progress.Canceled())// res = false; // if error, does nothing if(!res) return; // clear collected documents ClearDocuments(); // closes application Break(0); } // END TPdfFrontend::onCreate()
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:59,
示例17: CheckWrap bool CheckWrap(size_t len) { if (len + Column > WrapWidth) { Break(); return true; } return false; }
开发者ID:ArcticPheenix,项目名称:gzdoom,代码行数:9,
示例18: Push void Box::Damage(const int dmg, const int dmg_kind) { if ( dmg_kind >= DAMAGE_PUSH_UP ) { Push(X(), Y(), Z(), dmg_kind); if ( Sub()==DIFFERENT && IsEmpty() ) { Break(); } } else { Block::Damage(dmg, dmg_kind); } }
开发者ID:mmaulwurff,项目名称:FREG,代码行数:10,
示例19: ClearDocuments/////////////////////////////////////////////////////////////////////////////////////// cancel pdf creation handlervoid TPdfFrontend::onCancel(void){ if(DocumentList.GetCount() == 0 || PromptYesNo("Annullare la generazione ?")) { // remove pending poststript documents and closes app ClearDocuments(); Break(0); } } // END TPdfFrontend::onCancel()
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:12,
示例20: SaveFilevoid Ide::Exit(){ if(debugger) debugger->Stop(); SaveFile(); SaveWorkspace(); FlushFile(); console.Kill(); Break(IDOK); IdeExit = true;}
开发者ID:kolyden,项目名称:mirror,代码行数:11,
示例21: Breakvoid XMLMenuEditor::okCb(void){ // updates edited toolbars if(iFace) { iFace->SetCommands(commands); iFace->SetMenuBars(menusEditor.GetToolBars()); iFace->SetToolBars(barsEditor.GetToolBars()); } Break(IDOK); Close();}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:12,
示例22: Breakvoid C_PhysPropClientside::OnTakeDamage( int iDamage ) // very simple version{ if ( m_takedamage == DAMAGE_NO ) return; m_iHealth -= iDamage; if (m_iHealth <= 0) { Break(); }}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:12,
示例23: bPlayerResponsible/*================idBrittleFracture::Killed================*/void idBrittleFracture::Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location ) { bool bPlayerResponsible( false ); if( !disableFracture ) { ActivateTargets( this ); Break(); } if( attacker && attacker->IsType( idPlayer::Type ) ) { bPlayerResponsible = ( attacker == gameLocal.GetLocalPlayer() ); } else if( attacker && attacker->m_SetInMotionByActor.GetEntity() ) { bPlayerResponsible = ( attacker->m_SetInMotionByActor.GetEntity() == gameLocal.GetLocalPlayer() ); } gameLocal.m_MissionData->MissionEvent( COMP_DESTROY, this, bPlayerResponsible );}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:18,
示例24: Exclamationvoid OutMode::Export(int kind){ String ep = ~export_dir; if(IsNull(ep)) { Exclamation("Missing output directory!"); return; } if(kind == 2) ide.ExportMakefile(ep); else ide.ExportProject(ep, kind, true); Break(IDOK);}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:13,
示例25: Breakvoid DataListDefinitionDlg::OnSave(){ theDefList.name = ~edListName ; theDefList.fields.Clear() ; theDefList.fields.Add("NAME") ; theDefList.fields.Add("EMAIL") ; for (int i = 0; i < grid.GetCount(); i++) theDefList.fields.Add( grid.Get(i,0)) ; theDefList.Save() ; Break(IDOK) ;}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:14,
示例26: Checkfunc Check(){ if(!target) return RemoveObject(); if(!update) { if(temp > 100) { Break(); } } else { if(temp > 200) { Break(); } } SetPosition(target->GetX()+55,target->GetY()+40); if(target->~IsPegasusGate() && !update) { Update(); } return(1);}
开发者ID:maxmitti,项目名称:SGGP,代码行数:24,
示例27: EditHPvoid olterrain::ReceiveDamage(character* Villain, int Damage, int){ if(CanBeDestroyed() && Damage > GetStrengthValue()) { EditHP(GetStrengthValue() - Damage); if(HP <= 0) { room* Room = GetRoom(); Break(); if(Room) Room->DestroyTerrain(Villain); } }}
开发者ID:AdrianGin,项目名称:ivan,代码行数:16,
示例28: Break/*================c4tnt: now fractures can be broken at startidBrittleFracture::StartBroken================*/void idBrittleFracture::StartBroken( const float part, float disperse) { int i, counter; shard_t *shard; shard_t *shardorg; idVec3 point; if ( disperse > 0.9) disperse = 0.9f; if ( !IsBroken() ) { Break(); } counter = shards.Num() * part; if ( counter > shards.Num()) counter = shards.Num(); while (counter > 0) { for ( i = 0; i < shards.Num(); i++ ) { shardorg = shards[i]; if ( shardorg->droppedTime != -1 ) { continue; } if (gameLocal.random.RandomFloat() > disperse) { counter--; point = shardorg->clipModel->GetOrigin(); for ( i = 0; i < shards.Num(); i++ ) { shard = shards[i]; if ( shard->droppedTime != -1 || shard == shardorg) { continue; } if ( ( shard->clipModel->GetOrigin() - point ).LengthSqr() > Square( maxShatterRadius ) ) { continue; } counter--; DropShard( shard ); } DropShard( shardorg ); DropFloatingIslands( &counter ); } } }}
开发者ID:c4tnt,项目名称:DLR,代码行数:52,
示例29: Breakbool LoopManager::Continue(ScriptExecutionState* state, COMMAND_ARGS){ if (!m_loops.size()) return false; LoopInfo* loopInfo = &m_loops.top(); if (!loopInfo->loop->Update(PASS_COMMAND_ARGS)) { Break(state, PASS_COMMAND_ARGS); return true; } RestoreStack(state, &loopInfo->ipInfo); opcodeOffsetPtr[kDataDeltaStackOffset] += loopInfo->ipInfo.ip - (*opcodeOffsetPtr); return true;}
开发者ID:679565,项目名称:SkyrimOnline,代码行数:18,
示例30: Step void Step(Settings* settings) { if (m_break) { Break(); m_broke = true; m_break = false; } // Cache velocities to improve movement on breakage. if (m_broke == false) { m_velocity = m_body1->GetLinearVelocity(); m_angularVelocity = m_body1->GetAngularVelocity(); } Test::Step(settings); }
开发者ID:ZhuangChun,项目名称:Box2D,代码行数:18,
注:本文中的Break函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ BroadcastEvent函数代码示例 C++ Bread函数代码示例 |