コード例 #1
0
void VehiclePoolsManagerInSim::GetServicePool(AirsideFlightInSim* pFlight,int nVehicleTypeID, std::vector<int>& poolIDList)
{
	CVehicleTypePools* pPools = m_pVehiclePoolsAndDeployment->GetVehicleTypePools(nVehicleTypeID);

	if (pPools)
	{
		char mode = pFlight->IsArrivingOperation()?'A':'D';

		ALTObjectID objectID;
		if(pFlight->GetOperationParkingStand())
		 	objectID = pFlight->GetOperationParkingStand()->GetStandInput()->GetObjectName();
		else
		 	objectID = pFlight->GetFlightInput()->getStand();


		for (int i = 0; i < pPools->GetVehiclePoolCount(); i++)
		{
			CVehiclePool* pVehiclePool = pPools->GetVehiclePoolItem(i);
			std::vector<CVehicleServiceStandFamily*> standVector;
			pVehiclePool->GetServiceFitStand(objectID,standVector);

			for (size_t j = 0; j < standVector.size(); j++)
			{
				CVehicleServiceStandFamily* pStandFamily = standVector[j];
				if(pStandFamily->Fit(pFlight->GetLogEntry().GetAirsideDesc(),mode,pFlight->GetTime()))
				{
					int nID = pVehiclePool->GetParkingLotID();
					poolIDList.push_back(nID);
					break;
				}	
			}
		}
	}
}
コード例 #2
0
void VehiclePoolsManagerInSim::GetFollowMeCarServicePool( AirsideMeetingPointInSim* pMeetingPoint, int nVehicleTypeID, std::vector<int>& vPoolIDs )
{
	CVehicleTypePools* pPools = NULL;

	for (int i =0; i< m_pVehiclePoolsAndDeployment->GetVehicleTypePoolsCount(); i++ )
	{
		if ( m_pVehiclePoolsAndDeployment->GetVehicleTypePoolsItem(i))	
			if ( m_pVehiclePoolsAndDeployment->GetVehicleTypePoolsItem(i)->GetVehicleTypeID() == nVehicleTypeID)
			{
				pPools = m_pVehiclePoolsAndDeployment->GetVehicleTypePoolsItem(i);
				break;
			}
	}

	if (pPools)
	{	
		ALTObjectID MeetingPointName = pMeetingPoint->GetMeetingPointInput()->GetObjectName();
		int nCount = pPools->GetVehiclePoolCount();
		for (int i =0; i < nCount;i++)
		{
			CVehiclePool* pServicePool = pPools->GetVehiclePoolItem(i);
			if (pServicePool)
			{
				FollowMeCarServiceMeetingPoints* pMeetingPoints = pServicePool->GetFollowMeCarServiceMeetingPoints();
				
				int nPointCounts = pMeetingPoints->GetServiceMeetingPointCount();
				for (int j =0; j < nPointCounts; j++)
				{
					if (MeetingPointName.idFits(pMeetingPoints->GetServiceMeetingPoint(j)) == FALSE)
						continue;
										
					int nID = pServicePool->GetParkingLotID();
					vPoolIDs.push_back(nID);				
					
				}
			}
		}
	}
}