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


C++ LocationVector类代码示例

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


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

示例1: HookHandleRepop

bool RingOfTrials::HookHandleRepop(Player* plr)
{
	LocationVector dest;
	dest.ChangeCoords(4057.042725f, 2918.686523f, 13.051933f);
	plr->SafeTeleport(m_mapMgr->GetMapId(), m_mapMgr->GetInstanceID(), dest);
	return true;
}
开发者ID:lev1976g,项目名称:NoxicCore,代码行数:7,代码来源:RingOfTrials.cpp

示例2: SOTATeleporter

// 54640
bool SOTATeleporter( uint32 i, Spell *s ){
	Player *plr = s->GetPlayerTarget();
	if( plr == NULL )
		return true;

	LocationVector dest;
	uint32 closest_platform = 0;
	
	for(uint32 i = 0; i < 5; i++){
		float distance = plr->GetDistanceSq( sotaTransporterDestination[i][0], sotaTransporterDestination[i][1], sotaTransporterDestination[i][2]);
		
		if(distance < 75){
			closest_platform = i;
			break;
		}
	}
	
	dest.ChangeCoords(sotaTransporterDestination[closest_platform][0],
                      sotaTransporterDestination[closest_platform][1],
					  sotaTransporterDestination[closest_platform][2],
					  sotaTransporterDestination[closest_platform][3]);
	
	plr->SafeTeleport(plr->GetMapId(), plr->GetInstanceID(), dest);
	return true;
}
开发者ID:Antares84,项目名称:arcemu,代码行数:26,代码来源:MiscSpells.cpp

示例3: HookHandleRepop

bool EyeOfTheStorm::HookHandleRepop(Player * plr)
{
	uint32 i;
	int32 sval;
	uint32 t = plr->GetTeam();
	float dist = 999999.0f;
	float distcur;
	LocationVector dest;

	if(plr->GetTeam() == 0)
		sval = 100;
	else
		sval = 0;

	dest.ChangeCoords( EOTSStartLocations[t][0], EOTSStartLocations[t][1], EOTSStartLocations[t][2], 0 );

	for(i = 0; i < EOTS_TOWER_COUNT; ++i)
	{
		if( m_CPStatus[i] == sval )
		{
			distcur = plr->GetPositionNC().Distance2DSq( EOTSGraveyardLocations[i][0], EOTSGraveyardLocations[i][1] );
			if( distcur < dist )
			{
				dist = distcur;
				dest.ChangeCoords( EOTSGraveyardLocations[i][0], EOTSGraveyardLocations[i][1], EOTSGraveyardLocations[i][2], 0 );
			}
		}
	}

	plr->SafeTeleport(plr->GetMapId(), plr->GetInstanceID(), dest);
	return true;
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:32,代码来源:EyeOfTheStorm.cpp

示例4: HookHandleRepop

bool EyeOfTheStorm::HookHandleRepop(Player* plr)
{
    uint32 i;
    uint32 t = plr->GetTeam();
    float dist = 999999.0f;
    float distcur;
    LocationVector dest;

    dest.ChangeCoords( EOTSStartLocations[t][0], EOTSStartLocations[t][1], EOTSStartLocations[t][2], 0 );

    for(i = 0; i < EOTS_TOWER_COUNT; i++)
    {
        if( m_CPBanner[i] && m_CPBanner[i]->GetEntry() == EOTS_BANNER_ALLIANCE && t == 0 ||
              m_CPBanner[i]->GetEntry() == EOTS_BANNER_HORDE && t == 1 ||
              m_CPBanner2[i] && m_CPBanner2[i]->GetEntry() == EOTS_BANNER_ALLIANCE && t == 0 ||
              m_CPBanner2[i]->GetEntry() == EOTS_BANNER_HORDE && t == 1 ||
              m_CPBanner3[i] && m_CPBanner3[i]->GetEntry() == EOTS_BANNER_ALLIANCE && t == 0 ||
              m_CPBanner3[i]->GetEntry() == EOTS_BANNER_HORDE && t == 1 )
        {
            distcur = plr->GetPositionNC().Distance2DSq( EOTSGraveyardLocations[i][0], EOTSGraveyardLocations[i][1] );
            if( distcur < dist )
            {
                dist = distcur;
                dest.ChangeCoords( EOTSGraveyardLocations[i][0], EOTSGraveyardLocations[i][1], EOTSGraveyardLocations[i][2], 0 );
            }
        }
    }

    plr->SafeTeleport(plr->GetMapId(), plr->GetInstanceID(), dest);
    return true;
}
开发者ID:WowDevs,项目名称:Sandshroud,代码行数:31,代码来源:EyeOfTheStorm.cpp

示例5: HookHandleRepop

bool CircleOfBlood::HookHandleRepop(Player* plr)
{
    LocationVector dest;
    dest.ChangeCoords(6241.171875f, 261.067322f, 0.891833f);
    plr->SafeTeleport(m_mapMgr->GetMapId(), m_mapMgr->GetInstanceID(), dest);
    return true;
}
开发者ID:master312,项目名称:AscEmu,代码行数:7,代码来源:CircleOfBlood.cpp

示例6: HookHandleRepop

bool DalaranSewers::HookHandleRepop(Player* plr)
{
    LocationVector dest;
    dest.ChangeCoords(1292.51f, 792.05f, 9.34f);
    plr->SafeTeleport(m_mapMgr->GetMapId(), m_mapMgr->GetInstanceID(), dest);
    return true;
}
开发者ID:lev1976g,项目名称:AscEmu,代码行数:7,代码来源:DalaranSewers.cpp

示例7: HookHandleRepop

bool WarsongGulch::HookHandleRepop(Player * plr)
{
    LocationVector dest;
	if(plr->GetTeam())
		dest.ChangeCoords(1032.644775f, 1388.316040f, 340.559937f, 0.043200f);
	else
		dest.ChangeCoords(1423.218872f, 1554.663574f, 342.833801f, 3.124139f);
	plr->SafeTeleport(plr->GetMapId(), plr->GetInstanceID(), dest);
	return true;
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:10,代码来源:WarsongGulch.cpp

示例8: HandleTeleportCheatOpcode

void WorldSession::HandleTeleportCheatOpcode(WorldPacket & recv_data)
{
	float x,y,z,o;
	LocationVector vec;

	if(!HasGMPermissions())
	{
		SendNotification("You do not have permission to use this function.");
		return;
	}

	recv_data >> x >> y >> z >> o;
	vec.ChangeCoords(x,y,z,o);
	_player->SafeTeleport(_player->GetMapId(),_player->GetInstanceID(),vec);
}
开发者ID:wow4all,项目名称:wowtbc,代码行数:15,代码来源:MovementHandler.cpp

示例9:

   void PSU1Rules::BuildGenericSignal(const GenericTupleVector& genericTupleVec)
   {
      std::cout << "BUILDING Generic Signals " << std::endl;

      for(uint16_t idx=0; idx<genericTupleVec.size(); ++idx)
      {
         // get all port.channel locations
         LocationVector lv = genericTupleVec[idx].get<0>();

         // iterate through all locations and assign signal
         for(uint16_t jdx=0; jdx<lv.size(); ++jdx)
         {
            ports_[ChIndex(lv,jdx)] = genericTupleVec[idx].get<1>();
         } 
      }
   }
开发者ID:rseal,项目名称:BitPatternGenerator,代码行数:16,代码来源:PSU1Rules.cpp

示例10: DisassembleData

bool Disassembler::DisassembleData(LocationVector &LocationStack, istream &InputStream, uint64 &Address)
{
	bool fRetVal = true;
	unsigned int TempChar;
	Data *pData;
	while(InputStream.good() && Address < EndAddress)
	{
		//Get a byte of data from the stream.
		TempChar = InputStream.get();
		if(TempChar == -1)	//EOF
			break;

		//Add the byte to the sequence
		if((*TheProg.Segments.rbegin())->Sequence.empty())
		{
			//Create a new byte element.
			pData = new Data(LocationStack, DATA1, Addressability, new IntegerNumber(LocationStack, TempChar));
			(*TheProg.Segments.rbegin())->Sequence.push_back(pData);
			pData->Address = Address;
		}
		else
		{
			//Add the byte to an existing array.
			pData = reinterpret_cast<Data *>(*(*TheProg.Segments.rbegin())->Sequence.rbegin());
			pData->vData.push_back(new IntegerNumber(LocationStack, TempChar));
			pData->Length++;
			pData->Size++;
		}

		Address++;
		LocationStack.rbegin()->second++;
	}
	return fRetVal;
}
开发者ID:bjackson,项目名称:LC3Tools,代码行数:34,代码来源:Disassembler.cpp

示例11: OnPlatformTeleport

void IsleOfConquest::OnPlatformTeleport(Player* plr)
{
	LocationVector dest;
	uint32 closest_platform = 0;

	if(plr->GetTeam() == TEAM_ALLIANCE)
	{
		for (uint32 i = 0; i < 6; i++)
		{
			float distance = CalcDistance(plr->GetPositionX(),
				plr->GetPositionY(), plr->GetPositionZ(),
				iocTransporterDestination[i][0],
				iocTransporterDestination[i][1],
				iocTransporterDestination[i][2]);
			if (distance < 75 && distance > 10)
			{
				closest_platform = i;
				break;
			}
		}
		dest.ChangeCoords(iocTransporterDestination[closest_platform][0],
			iocTransporterDestination[closest_platform][1],
			iocTransporterDestination[closest_platform][2],
			iocTransporterDestination[closest_platform][3]);
	}
	else		// HORDE
	{
		for (uint32 i = 6; i < 12; i++)
		{
			float distance = CalcDistance(plr->GetPositionX(),
				plr->GetPositionY(), plr->GetPositionZ(),
				iocTransporterDestination[i][0],
				iocTransporterDestination[i][1],
				iocTransporterDestination[i][2]);
			if (distance < 75 && distance > 10)
			{
				closest_platform = i;
				break;
			}
		}
		dest.ChangeCoords(iocTransporterDestination[closest_platform][0],
			iocTransporterDestination[closest_platform][1],
			iocTransporterDestination[closest_platform][2],
			iocTransporterDestination[closest_platform][3]);
	}
	plr->SafeTeleport(plr->GetMapId(), plr->GetInstanceID(), dest);
}
开发者ID:Desch,项目名称:Edge-of-Chaos,代码行数:47,代码来源:IsleOfConquest.cpp

示例12: main

int main(int argc, char* argv[])
{
	cout << "\n\t\tLC-3 Assembler Converter 1.0, Ashley Wise\n\n";

	if(!ProcessArgs(argc, argv))
	{
		PrintUsage();
		return 0;
	}

	char sMessageBuffer[65 + MAX_FILENAME_CHAR];
	LocationVector LocationStack;
	bool fRetVal = true;

	for(unsigned int i = 0; i < InputList.size(); i++)
	{
		ifstream AsmFile(InputList[i].c_str());
		if(!AsmFile.good())
		{
			sprintf(sMessageBuffer, "Unable to open file %.255s", InputList[i].c_str());
			AsmCallBack(Fatal, sMessageBuffer, LocationVector());
			fRetVal = false;
			continue;
		}

		string sAsm3FileName = InputList[i]+"3";
		ofstream Asm3File(sAsm3FileName.c_str());
		if(!Asm3File.good())
		{
			sprintf(sMessageBuffer, "Unable to open file %.255s", sAsm3FileName.c_str());
			AsmCallBack(Fatal, sMessageBuffer, LocationVector());
			fRetVal = false;
			continue;
		}

		LocationStack.push_back( LocationVector::value_type(i, 1) );
		cout << "Translating " << InputList[i].c_str() << endl;
		if(!AsmConvertLC3(AsmFile, Asm3File, LocationStack, AsmCallBack))
		{
			fRetVal = false;
			continue;
		}
	}
	cout << endl;

	return 0;
}
开发者ID:bjackson,项目名称:LC3Tools,代码行数:47,代码来源:main.cpp

示例13:

WhereAmIResponse::WhereAmIResponse( const LocationVector &currPos )
{
	byte whereamipacket[] =
	{
		0x81, 0x54, 0x00, 0xB4, 0xC3, 0x46, 0x00, 0x80, 0xFC, 0xC3, 0x00, 0xE2, 0x01, 0x47, 0x07, 0x01,	0x00
	} ;

	currPos.toFloatBuf(&whereamipacket[2],sizeof(whereamipacket)-2);
	m_buf.clear();
	m_buf.append(whereamipacket,sizeof(whereamipacket));
}
开发者ID:TasteeWheat,项目名称:mxoemu1,代码行数:11,代码来源:MessageTypes.cpp

示例14: randomizeVector

void randomizeVector(LocationVector& V) {
	int n = V.size();
	int n2 = (int)(n/2);
	int rand_index = 0;
	for(int i = 0; i < n2;) {
		rand_index = rand() % n;
		if(!V[rand_index]) {
			V[rand_index] = true;
			i++;
		}
	}
}
开发者ID:lihitha,项目名称:vlsi-design-automation,代码行数:12,代码来源:main.cpp

示例15: round

   void PSU1Rules::BuildTxaSignal(const TxaTupleVector& txaTupleVec, 
         const TrTupleVector& trTupleVec, const double txa, const double bauda)
   {
      std::cout << "BUILDING TXA Signal " << std::endl;

      LocationVector lv = txaTupleVec[0].get<0>();
      const uint16_t pre_baud = round(trTupleVec[0].get<1>()/bauda);
      const double txa_baud = round(txa/bauda);

      for(uint16_t idx=0; idx<lv.size(); ++idx)
      {
         const uint16_t ch_idx = ChIndex(lv,idx);
         ports_[ch_idx].resize(pre_baud + txa_baud);

         for(uint16_t jdx=0; jdx<txa_baud; ++jdx)
         {
            const uint16_t txa_offset = jdx + pre_baud;
            ports_[ch_idx].set(txa_offset,true);
         }
      }
   }
开发者ID:rseal,项目名称:BitPatternGenerator,代码行数:21,代码来源:PSU1Rules.cpp


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