Example #1
0
        public override string CompInspectStringExtra()
        {
            CompProperties_Battery props = this.Props;
            string text = string.Concat(new string[]
            {
                "PowerBatteryStored".Translate(),
                ": ",
                StoredEnergy.ToString("F0"),
                " / ",
                props.storedEnergyMax.ToString("F0"),
                " Wd"
            });
            string text2 = text;

            text = string.Concat(new string[]
            {
                text2,
                "\n",
                "PowerBatteryEfficiency".Translate(),
                ": ",
                (chargeEfficiency * 100f).ToString("F0"),
                "%"
            });
            if (StoredEnergy > 0f)
            {
                text2 = text;
                text  = string.Concat(new string[]
                {
                    text2,
                    "\n",
                    "SelfDischarging".Translate(),
                    ": ",
                    5f.ToString("F0"),
                    " W"
                });
            }
            if (PowerNet == null)
            {
                return(text + "\n" + "PowerNotConnected".Translate());
            }
            string value  = (this.PowerNet.CurrentEnergyGainRate() / CompPower.WattsToWattDaysPerTick).ToString("F0");
            string value2 = this.PowerNet.CurrentStoredEnergy().ToString("F0");

            return(text + "\n" + "PowerConnectedRateStored".Translate(value, value2));
        }
 public override string CompInspectStringExtra()
 {
     return("PowerBatteryStored".Translate() + ": " + StoredEnergy.ToString("F0") + " / " + Props.storedEnergyMax.ToString("F0") + " Wd" + ", " + "PowerBatteryEfficiency".Translate() + ": " + (Props.efficiency * 100f).ToString("F0") + "%");
 }
Example #3
0
        public override string CompInspectStringExtra()
        {
            string devString = $"Stored: {StoredEnergy:F1} / {MaxStoredEnergy:F0}, pulling from {PullBatteriesCount} ({ReasonNoPull})";

            // Don't display the extra inspector info that the battery gives. It just clutters the inspector.
            // Optional, from props.
            if (!DoInspectorInfo)
            {
                if (Prefs.DevMode)
                {
                    return(devString);
                }
                return(null);
            }

            CompProperties_Battery p = this.Props;
            string text = devString + '\n' + "PowerBatteryStored".Translate() + ": " + StoredEnergy.ToString("F0") + " / " + MaxStoredEnergy.ToString("F0") + " Wd";

            text += "\n" + "PowerBatteryEfficiency".Translate() + ": " + (p.efficiency * 100f).ToString("F0") + "%";
            if (this.StoredEnergy > 0f)
            {
                text += "\n" + "SelfDischarging".Translate() + ": " + 5f.ToString("F0") + " W";
            }
            return(text + "\n" + GetBaseInspectString());
        }