当前位置: 首页>>代码示例>>C++>>正文


C++ Reset函数代码示例

本文整理汇总了C++中Reset函数的典型用法代码示例。如果您正苦于以下问题:C++ Reset函数的具体用法?C++ Reset怎么用?C++ Reset使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Reset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Reset

// Constructor
trpgAttach::trpgAttach()
{
    name = 0;
    Reset();
}
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:6,代码来源:trpage_nodes.cpp

示例2: boss_infinite_corruptorAI

 boss_infinite_corruptorAI(Creature* creature) : ScriptedAI(creature)
 {
     pInstance = me->GetInstanceScript();
     timeRift = NULL;
     Reset();
 }
开发者ID:Naios,项目名称:MythCore,代码行数:6,代码来源:boss_infinite.cpp

示例3: Result

void GameMain::Update(){
  if (true == is_game_end){
	  if (ResMed.Get(AudioKey::Game).isPlaying()){
		  ResMed.Get(AudioKey::Game).stop();
	  }
	if (!ResMed.Get(AudioKey::TimeOut).isPlaying()){
		ResMed.Get(AudioKey::TimeOut).play();
	}
  }
  if (true == is_end){
	  scene_manager->ChangeScene(std::shared_ptr<Result>(new Result(result)));
	  return;
  }

  if (!ResMed.Get(AudioKey::Game).isPlaying()){
    ResMed.Get(AudioKey::Game).play();
    ResMed.Get(AudioKey::Game).looping(true);
  }
  if (food_click_limit == 0){
    if (Collision::MouseToBox(App::Get().mousePosition(), food[0]->GetBox())){
      if (App::Get().isPushButton(Mouse::LEFT)){
        ResMed.Get(AudioKey::Eating).play();
        selected.push_back(SelectedFood(Position::Left, food[0]->GetFoodType(), food[0]->GetFoodVariation()));
        AddFood(food[0]->GetFoodType());
        Reset();
      }
    }

    if (App::Get().isPushKey(GLFW_KEY_LEFT_SHIFT) || App::Get().isPushKey('Z')){
      ResMed.Get(AudioKey::Eating).play();
      selected.push_back(SelectedFood(Position::Left, food[0]->GetFoodType(), food[0]->GetFoodVariation()));
      AddFood(food[0]->GetFoodType());
      Reset();
    }

    if (Collision::MouseToBox(App::Get().mousePosition(), food[1]->GetBox())){
      if (App::Get().isPushButton(Mouse::LEFT)){
        ResMed.Get(AudioKey::Eating).play();
        selected.push_back(SelectedFood(Position::Middle, food[1]->GetFoodType(), food[1]->GetFoodVariation()));
        AddFood(food[1]->GetFoodType());
        Reset();
      }
    }

    if (App::Get().isPushKey(GLFW_KEY_SPACE) || App::Get().isPushKey('B')){
      ResMed.Get(AudioKey::Eating).play();
      selected.push_back(SelectedFood(Position::Middle, food[1]->GetFoodType(), food[1]->GetFoodVariation()));
      AddFood(food[1]->GetFoodType());
      Reset();
    }

    if (Collision::MouseToBox(App::Get().mousePosition(), food[2]->GetBox())){
      if (App::Get().isPushButton(Mouse::LEFT) || App::Get().isPushKey(GLFW_KEY_RIGHT_SHIFT)){
        ResMed.Get(AudioKey::Eating).play();
        selected.push_back(SelectedFood(Position::Right, food[2]->GetFoodType(), food[2]->GetFoodVariation()));
        AddFood(food[2]->GetFoodType());
        Reset();
      }
    }

    if (App::Get().isPushKey(GLFW_KEY_RIGHT_SHIFT) || App::Get().isPushKey(GLFW_KEY_SLASH)){
      ResMed.Get(AudioKey::Eating).play();
      selected.push_back(SelectedFood(Position::Right, food[2]->GetFoodType(), food[2]->GetFoodVariation()));
      AddFood(food[2]->GetFoodType());
      Reset();
    }
  }

  for (auto& itr : selected){
    itr.Update();
  }

  UpdateList();
  if (true != is_game_end){
	  if (food_click_limit > 0){
		  food_click_limit--;
	  }
  }

  time_limit--;
  if (time_limit < ENDWAITTIME){
    is_game_end = true;
  }
  if (time_limit < 0){
	  is_end = true;
  }
}
开发者ID:Kent0911,项目名称:GameJam-11-18,代码行数:87,代码来源:gameMain.cpp

示例4: boss_hazzarahAI

 boss_hazzarahAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
开发者ID:520lly,项目名称:mangos-classic,代码行数:1,代码来源:boss_hazzarah.cpp

示例5: mob_frost_bombAI

 mob_frost_bombAI(Creature* pCreature) : ScriptedAI(pCreature)
 {
     m_pInstance = (instance_icecrown_citadel*)pCreature->GetInstanceData();
     Reset();
 }
开发者ID:conan513,项目名称:mangos-wotlk,代码行数:5,代码来源:boss_sindragosa.cpp

示例6: surface

void ProcessModeMatch::InitProcess()
{
	if (!Enabled) return;

	if (m_Eng_Interface==NULL)
	{
		cerr << "ProcessModeMatch::InitProcess: Error, Engine_Interface is NULL, abort mode mathcing..." << endl;
		Enabled=false;
		return;
	}
	m_Eng_Interface->SetInterpolationType(Engine_Interface_Base::NODE_INTERPOLATE);

	int Dump_Dim=0;
	m_ny = -1;
	for (int n=0; n<3; ++n)
	{
		if (start[n]>stop[n])
		{
			unsigned int help=start[n];
			start[n]=stop[n];
			stop[n]=help;
		}

		//exclude boundaries from mode-matching
		if (start[n]==0)
			++start[n];
		if (stop[n]==Op->GetNumberOfLines(n)-1)
			--stop[n];

		if (stop[n]!=start[n])
			++Dump_Dim;

		if (stop[n] == start[n])
			m_ny = n;
	}

	if ((Dump_Dim!=2) || (m_ny<0))
	{
		cerr << "ProcessModeMatch::InitProcess(): Warning Mode Matching Integration Box \"" << m_filename << "\" is not a surface (found dimension: " << Dump_Dim << ")" << endl;
		SetEnable(false);
		Reset();
		return;
	}

	int nP = (m_ny+1)%3;
	int nPP = (m_ny+2)%3;
	m_numLines[0] = stop[nP] - start[nP] + 1;
	m_numLines[1] = stop[nPP] - start[nPP] + 1;

	for (int n=0; n<2; ++n)
	{
		int ny = (m_ny+n+1)%3;
		int res = m_ModeParser[n]->Parse(m_ModeFunction[ny], "x,y,z,rho,a,r,t");
		if (res >= 0)
		{
			cerr << "ProcessModeMatch::InitProcess(): Warning, an error occured parsing the mode matching function (see below) ..." << endl;
			cerr << m_ModeFunction[ny] << "\n" << string(res, ' ') << "^\n" << m_ModeParser[n]->ErrorMsg() << "\n";
			SetEnable(false);
			Reset();
		}
	}

	for (int n=0; n<2; ++n)
	{
		m_ModeDist[n] = Create2DArray<double>(m_numLines);
	}

	unsigned int pos[3] = {0,0,0};
	double discLine[3] = {0,0,0};
	double gridDelta = 1; // 1 -> mode-matching function is definied in drawing units...
	double var[7];
	pos[m_ny] = start[m_ny];
	discLine[m_ny] = Op->GetDiscLine(m_ny,pos[m_ny],m_dualMesh);
	double norm = 0;
	double area = 0;
	for (unsigned int posP = 0; posP<m_numLines[0]; ++posP)
	{
		pos[nP] = start[nP] + posP;
		discLine[nP] = Op->GetDiscLine(nP,pos[nP],m_dualMesh);
		for (unsigned int posPP = 0; posPP<m_numLines[1]; ++posPP)
		{
			pos[nPP] = start[nPP] + posPP;
			discLine[nPP] = Op->GetDiscLine(nPP,pos[nPP],m_dualMesh);

			var[0] = discLine[0] * gridDelta; // x
			var[1] = discLine[1] * gridDelta; // y
			var[2] = discLine[2] * gridDelta; // z
			var[3] = sqrt(discLine[0]*discLine[0] + discLine[1]*discLine[1]) * gridDelta; // rho = sqrt(x^2 + y^2)
			var[4] = atan2(discLine[1], discLine[0]); // a = atan(y,x)
			var[5] = sqrt(pow(discLine[0],2)+pow(discLine[1],2)+pow(discLine[2],2)) * gridDelta; // r
			var[6] = asin(1)-atan(var[2]/var[3]); //theta (t)

			if (m_Mesh_Type == CYLINDRICAL_MESH)
			{
				var[3] = discLine[0] * gridDelta; // rho
				var[4] = discLine[1]; // a
				var[0] = discLine[0] * cos(discLine[1]) * gridDelta; // x = r*cos(a)
				var[1] = discLine[0] * sin(discLine[1]) * gridDelta; // y = r*sin(a)
				var[5] = sqrt(pow(discLine[0],2)+pow(discLine[2],2)) * gridDelta; // r
				var[6] = asin(1)-atan(var[2]/var[3]); //theta (t)
//.........这里部分代码省略.........
开发者ID:anashed,项目名称:openEMS,代码行数:101,代码来源:processmodematch.cpp

示例7: mob_omrogg_headsAI

 mob_omrogg_headsAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
开发者ID:wowfrank,项目名称:diamondcore,代码行数:1,代码来源:boss_warbringer_omrogg.cpp

示例8: npc_letollAI

 npc_letollAI(Creature* pCreature) : npc_escortAI(pCreature)
 {
     m_uiEventTimer = 5000;
     m_uiEventCount = 0;
     Reset();
 }
开发者ID:Agustin1010,项目名称:Oregon-Core,代码行数:6,代码来源:terokkar_forest.cpp

示例9: npc_mana_bomb_exp_triggerAI

 npc_mana_bomb_exp_triggerAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
开发者ID:Agustin1010,项目名称:Oregon-Core,代码行数:1,代码来源:terokkar_forest.cpp

示例10: npc_captive_child

 npc_captive_child(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
开发者ID:Agustin1010,项目名称:Oregon-Core,代码行数:1,代码来源:terokkar_forest.cpp

示例11: npc_akunoAI

 npc_akunoAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); }
开发者ID:Agustin1010,项目名称:Oregon-Core,代码行数:1,代码来源:terokkar_forest.cpp

示例12: Free

	// Frees a list.
	virtual void Free() {
		if (the_list_ != NULL)
			free(the_list_);
		Reset();
	}
开发者ID:neilgroves,项目名称:MlbDev,代码行数:6,代码来源:C_StringSupport.hpp

示例13: Walk

/********************************************************************************
 Update the camera
 ********************************************************************************/
void Camera3::Update(double dt)
{
	// WASD movement
	if ( myKeys['w'] == true)
	{
		Walk( dt );
	}
	else
	{
		MoveVel_W = 0.0f;
	}
	if (myKeys['s'] == true)
	{
		Walk( -dt );
	}
	else
	{
		MoveVel_S = 0.0f;
	}
	if (myKeys['a'] == true)
	{
		Strafe( -dt );
	}
	else
	{
		MoveVel_A = 0.0f;
	}
	if (myKeys['d'] == true)
	{
		Strafe( dt );
	}
	else
	{
		MoveVel_D = 0.0f;
	}

	// Rotation
	if ( myKeys[VK_UP] == true)
	{
		LookUp( dt );
	}
	if (myKeys[VK_DOWN] == true)
	{
		LookUp( -dt );
	}
	if (myKeys[VK_LEFT] == true)
	{
		TurnLeft( -dt );
	}
	if (myKeys[VK_RIGHT] == true)
	{
		TurnRight( dt );
	}

	// Jump
	if (myKeys[32] == true)
	{
		Jump( dt );
		myKeys[32]	= false;
	}
	UpdateJump(dt);

	//Update the camera direction based on mouse move
	// left-right rotate
	if ( Application::camera_yaw != 0 )
		Yaw( dt );
	if ( Application::camera_pitch != 0 )
		Pitch( dt );

	if(Application::IsKeyPressed('R'))
	{
		Reset();
	}
}
开发者ID:Glenn-Pao,项目名称:SP4,代码行数:77,代码来源:Camera3.cpp

示例14: Reset

PipeStream::~PipeStream() {
  Reset();
}
开发者ID:dacci,项目名称:madoka,代码行数:3,代码来源:pipe_stream_win.cpp

示例15: vHavokConstraintChainDesc

// ----------------------------------------------------------------------------
vHavokStiffSpringConstraintChainDesc::vHavokStiffSpringConstraintChainDesc()
: vHavokConstraintChainDesc(false)
{
  Reset();
}
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:6,代码来源:vHavokStiffSpringConstraintChain.cpp


注:本文中的Reset函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。