Пример #1
0
 public void Request_viable_parts(VehiclePart_CHASSIS _chassis)
 {
     foreach (KeyValuePair <VehiclePart_Config, int> _PAIR in currentTask.requiredParts)
     {
         VehiclePart_Config _PART = _PAIR.Key;
         int _QUANTITY            = _PAIR.Value;
         if (_PART.partType != Vehicle_PartType.CHASSIS)
         {
             if (currentTask.requiredParts.ContainsKey(_PAIR.Key))
             {
                 if (factoryMode == FactoryMode.OOP)
                 {
                     if (_chassis.partsFitted.ContainsKey(_PART))
                     {
                         if (_chassis.partsFitted[_PART] >= _QUANTITY)
                         {
                             continue;
                         }
                     }
                 }
                 L1.Request_part(new VehiclePartRequest(_PAIR.Key, REG));
                 REG.waitingForPartType = _chassis.partsNeeded[0].partConfig;
                 if (!purgingPartsToSharedStorage)
                 {
                     REG.Change_state(StorageState.WAITING);
                 }
                 return;
             }
         }
     }
 }