public double supplyFNResourcePerSecondWithMax(double supply, double maxsupply, String resourcename) { ResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.powerSupplyPerSecondWithMax(this, Math.Max(supply, 0), Math.Max(maxsupply, 0))); }
public double supplyFNResourcePerSecondWithMax(double supply, double maxsupply, String resourcename) { if (supply.IsInfinityOrNaN() || maxsupply.IsInfinityOrNaN() || String.IsNullOrEmpty(resourcename)) { Debug.LogError("[KSPI]: supplyFNResourcePerSecondWithMax was called with illegal value"); return(0); } ResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.powerSupplyPerSecondWithMax(this, Math.Max(supply, 0), Math.Max(maxsupply, 0))); }
public double supplyFNResourcePerSecondWithMax(double supply, double maxsupply, String resourcename) { if (double.IsNaN(supply) || double.IsNaN(maxsupply) || String.IsNullOrEmpty(resourcename)) { Debug.Log("[KSPI] - supplyFNResourcePerSecondWithMax illegal values."); return(0); } ResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.powerSupplyPerSecondWithMax(this, Math.Max(supply, 0), Math.Max(maxsupply, 0))); }