public override void PostExposeData() { base.PostExposeData(); Scribe_Values.Look(ref storedEnergy, "storedPower", 0f); CompProperties_Battery props = Props; if (storedEnergy > props.storedEnergyMax) { storedEnergy = props.storedEnergyMax; } }
public override void PostExposeData() { base.PostExposeData(); Scribe_Values.Look <float>(ref this.storedEnergy, "storedPower", 0f, false); CompProperties_Battery props = this.Props; if (this.storedEnergy > props.storedEnergyMax) { this.storedEnergy = props.storedEnergyMax; } }
public override string CompInspectStringExtra() { CompProperties_Battery props = Props; string t = "PowerBatteryStored".Translate() + ": " + storedEnergy.ToString("F0") + " / " + props.storedEnergyMax.ToString("F0") + " Wd"; t += "\n" + "PowerBatteryEfficiency".Translate() + ": " + (props.efficiency * 100f).ToString("F0") + "%"; if (storedEnergy > 0f) { t += "\n" + "SelfDischarging".Translate() + ": " + 5f.ToString("F0") + " W"; } return(t + "\n" + base.CompInspectStringExtra()); }
public override string CompInspectStringExtra() { CompProperties_Battery props = this.Props; string text = "PowerBatteryStored".Translate() + ": " + this.storedEnergy.ToString("F0") + " / " + props.storedEnergyMax.ToString("F0") + " Wd"; string text2 = text; text = text2 + "\n" + "PowerBatteryEfficiency".Translate() + ": " + ((float)(props.efficiency * 100.0)).ToString("F0") + "%"; if (this.storedEnergy > 0.0) { text2 = text; text = text2 + "\n" + "SelfDischarging".Translate() + ": " + 5f.ToString("F0") + " W"; } return(text + "\n" + base.CompInspectStringExtra()); }
public override string CompInspectStringExtra() { CompProperties_Battery props = this.Props; string text = string.Concat(new string[] { "PowerBatteryStored".Translate(), ": ", this.storedEnergy.ToString("F0"), " / ", props.storedEnergyMax.ToString("F0"), " Wd" }); string text2 = text; text = string.Concat(new string[] { text2, "\n", "PowerBatteryEfficiency".Translate(), ": ", (props.efficiency * 100f).ToString("F0"), "%" }); if (this.storedEnergy > 0f) { text2 = text; text = string.Concat(new string[] { text2, "\n", "SelfDischarging".Translate(), ": ", 5f.ToString("F0"), " W" }); } return(text + "\n" + base.CompInspectStringExtra()); }