public override void PreAbsorbStack(Thing otherStack, int count)
        {
            float t = (float)count / (float)(this.parent.stackCount + count);
            CompTemperatureRuinable comp = ((ThingWithComps)otherStack).GetComp <CompTemperatureRuinable>();

            this.ruinedPercent = Mathf.Lerp(this.ruinedPercent, comp.ruinedPercent, t);
        }
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(base.GetInspectString());
            if (stringBuilder.Length != 0)
            {
                stringBuilder.AppendLine();
            }
            CompTemperatureRuinable comp = base.GetComp <CompTemperatureRuinable>();

            if (!this.Empty && !comp.Ruined)
            {
                if (this.Fermented)
                {
                    stringBuilder.AppendLine("ContainsBeer".Translate(this.wortCount, 25));
                }
                else
                {
                    stringBuilder.AppendLine("ContainsWort".Translate(this.wortCount, 25));
                }
            }
            if (!this.Empty)
            {
                if (this.Fermented)
                {
                    stringBuilder.AppendLine("Fermented".Translate());
                }
                else
                {
                    stringBuilder.AppendLine("FermentationProgress".Translate(this.Progress.ToStringPercent(), this.EstimatedTicksLeft.ToStringTicksToPeriod()));
                    if (this.CurrentTempProgressSpeedFactor != 1f)
                    {
                        stringBuilder.AppendLine("FermentationBarrelOutOfIdealTemperature".Translate(this.CurrentTempProgressSpeedFactor.ToStringPercent()));
                    }
                }
            }
            stringBuilder.AppendLine("Temperature".Translate() + ": " + base.AmbientTemperature.ToStringTemperature("F0"));
            stringBuilder.AppendLine(string.Concat(new string[]
            {
                "IdealFermentingTemperature".Translate(),
                ": ",
                7f.ToStringTemperature("F0"),
                " ~ ",
                comp.Props.maxSafeTemperature.ToStringTemperature("F0")
            }));
            return(stringBuilder.ToString().TrimEndNewlines());
        }
        public override void PostSplitOff(Thing piece)
        {
            CompTemperatureRuinable comp = ((ThingWithComps)piece).GetComp <CompTemperatureRuinable>();

            comp.ruinedPercent = this.ruinedPercent;
        }
        public override bool AllowStackWith(Thing other)
        {
            CompTemperatureRuinable comp = ((ThingWithComps)other).GetComp <CompTemperatureRuinable>();

            return(this.Ruined == comp.Ruined);
        }