NearFutureElectrical.DischargeCapacitor.DoCatchup C# (CSharp) Method

DoCatchup() private method

private DoCatchup ( ) : void
return void
        private void DoCatchup()
        {
            if (lastUpdateTime < Planetarium.fetch.time)
              {
            if (Enabled && !Discharging)
            {
                Utils.Log(String.Format("Recharged capacitor in background: {0}", Planetarium.fetch.time -lastUpdateTime));
              int ECID = PartResourceLibrary.Instance.GetDefinition("ElectricCharge").id;
              double ec = 0d;
              double outEc = 0d;
              part.GetConnectedResourceTotals(ECID, out ec, out outEc, true);
              if (ec / outEc >= 0.25d)
                {
                  float amtScaled = Mathf.Clamp((float)( Planetarium.fetch.time -lastUpdateTime) * ChargeRate, 0f, MaximumCharge);

                  Utils.Log(String.Format("Recharged: {0}", -amtScaled * ChargeRatio));
                  this.part.RequestResource("StoredCharge", -amtScaled * ChargeRatio, ResourceFlowMode.NO_FLOW);

                }
            }
              }
        }