/// <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); }
protected override void OnUnregister() { ResourceConsumptionChecker.UnRegister(); base.OnUnregister(); }
void Start() { Instance = this; }