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


C++ Mover::getPilot方法代码示例

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


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

示例1: initializeLogData

void Logistics::initializeLogData()
{
	LogisticsData::instance->removeMechsInForceGroup();

	LogisticsData::instance->init();
	Team* pTeam = Team::home;

	if ( pTeam )
	{
		for ( int i = pTeam->getRosterSize() - 1; i > -1; i-- )
		{
			Mover* pMover = (Mover*)pTeam->getMover( i );
			LogisticsPilot* pPilot = LogisticsData::instance->getPilot(pMover->getPilot()->getName());

			unsigned long base, highlight1, highlight2;
			((Mech3DAppearance*)pMover->getAppearance())->getPaintScheme( highlight1, 
				highlight2, base );
			
			
			if ( pMover->getObjectType()->getObjectTypeClass() == BATTLEMECH_TYPE )
			{
				LogisticsVariant* pVar = LogisticsData::instance->getVariant( ((BattleMech*)pMover)->variantName );
				LogisticsData::instance->addMechToInventory( 
					pVar, 1, pPilot,
					base, highlight1, highlight2 );
			}
		}
	}
}
开发者ID:Jacic,项目名称:MechCommander2,代码行数:29,代码来源:logistics.cpp

示例2: beginMission


//.........这里部分代码省略.........

	if (mission)
		mission->destroy();

	long numPlayers = 1;
	if ( MPlayer )
		MPlayer->getPlayers(numPlayers);
	long numMoversPerCommander[MAX_MC_PLAYERS] = {12, 12, 12, 9, 7, 6, 5, 4};
	Stuff::Vector3D dropZoneList[255]; // ubsurdly large, but sometimes we overrun this.
	long dropZoneID = 0;
	if (MPlayer) {
		//dropZoneID = MPlayer->commanderID;
		for (long i = 0; i < MAX_MC_PLAYERS; i++)
			if (commandersToLoad[i][0] == MPlayer->commanderID) {
				dropZoneID = i;
				break;
			}
		useUnlimitedAmmo = MPlayer->missionSettings.unlimitedAmmo;
	}

	mission->init((char*)(const char*)LogisticsData::instance->getCurrentMission(), missionLoadType, dropZoneID, dropZoneList, commandersToLoad, numMoversPerCommander[numPlayers - 1]);

	LogisticsData::instance->rpJustAdded = 0;

	if (MPlayer) {
		if (missionLoadType == MISSION_LOAD_MP_LOGISTICS) {
			EList< LogisticsMech*, LogisticsMech* > list;
			LogisticsData::instance->getForceGroup(list);

			long dropZoneIndex = 0;
			long numMechs = 0;
			for (EList< LogisticsMech*, LogisticsMech* >::EIterator iter = list.Begin(); !iter.IsDone(); iter++) {
				numMechs++;
				if ( !(*iter)->getPilot() )
					continue;
				CompressedMech mechData;
				mechData.lastMech = (list.Count() == numMechs);
				mechData.objNumber =  (*iter)->getFitID();
				mechData.commanderID = MPlayer->commanderID;
				mechData.baseColor = MPlayer->colors[MPlayer->playerInfo[MPlayer->commanderID].baseColor[BASECOLOR_TEAM]];
				mechData.highlightColor1 = MPlayer->colors[MPlayer->playerInfo[MPlayer->commanderID].stripeColor];
				mechData.highlightColor2 = MPlayer->colors[MPlayer->playerInfo[MPlayer->commanderID].stripeColor];
				strcpy(mechData.pilotFile, (*iter)->getPilot()->getFileName());
				strcpy(mechData.mechFile, (*iter)->getFileName());
				strcpy(mechData.variantName, (*iter)->getName());
				mechData.variantNum = (*iter)->getVariant()->getFileID();
				mechData.cBills = (*iter)->getVariant()->getCost();
				mechData.pos[0] = dropZoneList[dropZoneIndex].x;
				mechData.pos[1] = dropZoneList[dropZoneIndex++].y;
				mechData.designerMech = (*iter)->getVariant()->isDesignerMech();
				mechData.numComponents = (*iter)->getComponentCount();
				if (mechData.numComponents)	{
					long* componentList = (long*)systemHeap->Malloc(sizeof(long) * mechData.numComponents);
					long otherCount = mechData.numComponents;
					(*iter)->getComponents(otherCount, componentList);
					if (otherCount != mechData.numComponents)
						STOP(("Heidi's getComponentCount does not agree with count returned from getComponents"));
					for (long i = 0; i < mechData.numComponents; i++)
						mechData.components[i] = (unsigned char)componentList[i];
				}
				MPlayer->sendMissionSetup(0, 1, &mechData);
			}

			if (!MPlayer->waitTillMechDataReceived()) {
				// SERVER DROPPED
				mission->destroy();
开发者ID:Jacic,项目名称:MechCommander2,代码行数:67,代码来源:logistics.cpp


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