public override void SpawnSetup(Map map) { base.SpawnSetup(map); this.UpdateEntries(); this.compTithe = this.TryGetComp <CompTitheContainer>(); if (this.compTithe == null) { Log.Error("No CompTithe found for Tithe Container. Defaulting."); this.compTithe = new CompTitheContainer(); } this.GetActiveThingDefs(); }
public static float SpaceRemainingForThing(CompTitheContainer titheContainer, Thing t) { return(Mathf.Clamp((titheContainer.tProps.maxContainerCapacity * (1 - titheContainer.massUsage)) / t.GetStatValue(StatDefOf.Mass), 0f, titheContainer.tProps.maxContainerCapacity)); }