public override void PostSplitOff(Thing piece) { AC_CompFermenter comp = ((ThingWithComps)piece).GetComp <AC_CompFermenter>(); comp.fermentProgress = this.fermentProgress; comp.ruinedPercent = this.ruinedPercent; }
public override void PreAbsorbStack(Thing otherStack, int count) { float t = (float)count / (float)(this.parent.stackCount + count); AC_CompFermenter comp = ((ThingWithComps)otherStack).GetComp <AC_CompFermenter>(); float b = comp.fermentProgress; this.ruinedPercent = Mathf.Lerp(this.ruinedPercent, comp.ruinedPercent, t); this.fermentProgress = Mathf.Lerp(this.fermentProgress, b, t); }
public override string GetInspectString() { CompProperties_AC_Fermenter compProperties = this.def.GetCompProperties <CompProperties_AC_Fermenter>(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(base.GetInspectString()); if (stringBuilder.Length != 0) { stringBuilder.AppendLine(); } AC_CompFermenter comp = base.GetComp <AC_CompFermenter>(); if (!this.Empty && !comp.Ruined) { if (this.Fermented) { stringBuilder.AppendLine(string.Concat(new string[] { "AC.ContainsFermentedCompost".Translate(), ": ", this.compostCount.ToString(), " / ", this.Capacity.ToString() })); } else { stringBuilder.AppendLine(string.Concat(new string[] { "AC.ContainsRawCompost".Translate(), ": ", this.compostCount.ToString(), " / ", this.Capacity.ToString() })); } } stringBuilder.AppendLine("AC.Temp".Translate() + ": " + base.AmbientTemperature.ToStringTemperature("F0")); stringBuilder.AppendLine(string.Concat(new string[] { "AC.IdealTemp".Translate(), ": ", compProperties.minFermentTemp.ToStringTemperature("F0"), "-", compProperties.maxFermentTemp.ToStringTemperature("F0") })); return(stringBuilder.ToString().TrimEndNewlines()); }
public override bool AllowStackWith(Thing other) { AC_CompFermenter comp = ((ThingWithComps)other).GetComp <AC_CompFermenter>(); return(this.Ruined == comp.Ruined); }