コード例 #1
0
        public override string CompInspectStringExtra()
        {
            CompProperties_ShieldBattery 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"),
                "%"
            });
            return(text + "\n" + base.CompInspectStringExtra());
        }
コード例 #2
0
        public override void PostExposeData()
        {
            base.PostExposeData();
            Scribe_Values.Look <float>(ref this.storedEnergy, "storedPower", 0f, false);
            CompProperties_ShieldBattery props = this.Props;

            if (this.storedEnergy > props.storedEnergyMax)
            {
                this.storedEnergy = props.storedEnergyMax;
            }
        }