public double supplyFNResourceFixedWithMax(double supply, double maxsupply, String resourcename)
        {
            ResourceManager manager = getManagerForVessel(resourcename);

            if (manager == null)
            {
                return(0);
            }

            return(manager.powerSupplyFixedWithMax(this, Math.Max(supply, 0), Math.Max(maxsupply, 0)));
        }
        public double supplyFNResourceFixedWithMax(double supply, double maxsupply, String resourcename)
        {
            if (supply.IsInfinityOrNaN() || maxsupply.IsInfinityOrNaN() || String.IsNullOrEmpty(resourcename))
            {
                Debug.LogError("[KSPI]: supplyFNResourceFixedWithMax  was called with illegal value");
                return(0);
            }

            ResourceManager manager = getManagerForVessel(resourcename);

            if (manager == null)
            {
                return(0);
            }

            return(manager.powerSupplyFixedWithMax(this, Math.Max(supply, 0), Math.Max(maxsupply, 0)));
        }
示例#3
0
        public double supplyFNResourceFixedWithMax(double supply, double maxsupply, String resourcename)
        {
            if (double.IsNaN(supply) || double.IsNaN(maxsupply) || String.IsNullOrEmpty(resourcename))
            {
                Debug.Log("[KSPI] - supplyFNResourceFixedWithMax illegal values.");
                return(0);
            }

            ResourceManager manager = getManagerForVessel(resourcename);

            if (manager == null)
            {
                return(0);
            }

            return(manager.powerSupplyFixedWithMax(this, Math.Max(supply, 0), Math.Max(maxsupply, 0)));
        }