コード例 #1
0
        /// <summary>
        /// Whether this vessel meets the parameter condition.
        /// </summary>
        /// <param name="vessel">The vessel to check</param>
        /// <returns>Whether the vessel meets the condition</returns>
        protected override bool VesselMeetsCondition(Vessel vessel)
        {
            LoggingUtil.LogVerbose(this, "Checking VesselMeetsCondition: " + vessel.id);

            double delta = 0.0;

            if (ResourceConsumptionChecker.CanCheckVessel(vessel))
            {
                delta = ResourceConsumptionChecker.Instance.Consumption(resource);
            }
            else
            {
                return(false);
            }

            LoggingUtil.LogVerbose(this, "Delta for resource " + resource.name + " is: " + delta);
            return(delta - minRate >= -0.001 && maxRate - delta >= -0.001);
        }
コード例 #2
0
 protected override void OnUnregister()
 {
     ResourceConsumptionChecker.UnRegister();
     base.OnUnregister();
 }
コード例 #3
0
 void Start()
 {
     Instance = this;
 }
コード例 #4
0
 void Start()
 {
     Instance = this;
 }