ILiquidContainer
An interface in Root.Township, Alta.Liquid.
Anything that can hold liquid in whole units: buckets, flasks, cauldrons (LiquidContainer) and endless sources such as water (StaticLiquidContainer). Filling and emptying only works on the server.
- Listed in Stats, effects, heat and liquid
- Derived types
LiquidContainer,StaticLiquidContainer - Documented in Liquids
Properties
| Member | What it is |
|---|---|
bool CanRemoveFrom { get; set; } | Whether liquid can be taken out of this container (unless the fill is forced). |
LiquidContent ContainedLiquid { get; } | The liquid currently inside, or null when empty. |
int ContainerPriority { get; } | Higher priority containers fill lower ones they touch, not the other way round. Static sources use 1000. |
int ContainerSize { get; } | How many units the container holds. int.MaxValue for static sources. |
int CurrentContentLevel { get; } | How many units are inside now. |
NetworkEntity Entity { get; } | The network entity of the container, or null for static sources. |
GameObject gameObject { get; } | The Unity object the container lives on. |
bool IsAllowingGradualConsumption { get; } | Whether a gradual drinker (sipping) can drink from it. False for static sources. |
bool IsEmpty { get; } | True when no liquid is inside. |
bool IsFull { get; } | True when there is no space left. |
float ReceiveTransitionMultiplier { get; } | Speeds up liquid transitions (such as heating into another liquid) while in this container. 1 by default. |
int SpaceLeft { get; } | Units that still fit. |
LiquidSurfaceVisual SurfaceVisual { get; } | The visual that shows the liquid surface, or null. |
float TotalLiquidAmountShown { get; } | Amount used for the fill visual: the content level plus any transitions in progress. |
Events
| Member | What it is |
|---|---|
event LiquidFillFilter AddFilter | Event that can veto a liquid before it is added; CanAddTo runs it. |
event LiquidTypeChangedHandler ContainedLiquidChanged | Raised when the type of liquid inside changes. |
event LiquidContainerAmountChangedHandler ContentLevelChanged | Raised when the amount inside changes. |
event LiquidContainerHandler TotalAmountShownChanged | Raised when TotalLiquidAmountShown changes. |
Methods
| Member | What it is |
|---|---|
bool CanAddTo(LiquidContent liquid) | Whether this container accepts the given liquid: the container must allow adding and no AddFilter handler may refuse. |
bool FillIntoContainer(ILiquidContainer otherContainer, int otherContainerSpace, bool isForced = false) | Server: moves a number of units into another container. Fails if incompatible, refused, or there is not enough liquid or space. |
void ForceEmpty() | Empties the container regardless of CanRemoveFrom. |
bool IsCompatibleWithOtherContainer(ILiquidContainer liquidContainer) | True if either side is empty or both hold the same liquid. |
Used in
Members of other types that take, return or hold a ILiquidContainer:
CookingLiquid.liquidContainer, CookingLiquid.LiquidContainer, CookingLiquid.LiquidContainerContentLevelChanged, CookingLiquidVisual.container, CookingLiquidVisualTippingPointController.SetVisualsTippingPointToNewLiquidLevel, LiquidChunkVisuals.container, LiquidChunkVisuals.UpdateLiquidChunks, BoilingParticles.container, BoilingParticles.SetupForContainer, BoilingParticles.UpdateParticleLifetimesBaseOnContentLevel, ContainerLiquidReceiver.container, ContainerLiquidReceiver.Container, GlobalLiquidContainer.FillLiquidIntoContainer, GlobalLiquidContainer.RemoveLiquidFromContainer, ILiquidParticlesMarker.Container, IPourableContainer.InternalContainer, IPourableContainer.RegisterPouringParticleHit, LiquidContainer.FillInto, LiquidContainer.FillIntoContainer, LiquidContainer.IsCompatibleWithOtherContainer, LiquidContainerAmountChangedHandler.BeginInvoke, LiquidContainerAmountChangedHandler.Invoke, LiquidContainerHandler.BeginInvoke, LiquidContainerHandler.Invoke, LiquidContainerLid.container, LiquidContainerLid.Container, LiquidContainerTrigger.ContainerContentLevelChanged, LiquidContainerTrigger.FillOtherContainer, LiquidContainerTrigger.handledLiquidContainers, LiquidContainerTrigger.thisContainer, LiquidHeatAreaController.SetHeatAreaEnabled, LiquidParticleMarker.Container, LiquidPouringParticlesMarker.Container, LiquidPouringParticlesMarker.RegisterPouringParticleHit, LiquidStencilShaderController.container, LiquidStencilShaderController.HandleLiquidLevelChanged, LiquidTransition.LiquidTransition, LiquidTransition.receivingContainer, LiquidTransition.ReceivingContainer, LiquidTransition.SetTarget, LiquidTransition.sourceContainer, LiquidTransition.SourceContainer, PourableContainer.container, PourableContainer.ContainerContentAmountChanged, PourableContainer.destinationContainerHitCounts, PourableContainer.FindMostPouredIntoContainer, PourableContainer.InternalContainer, PourableContainer.RegisterPouringParticleHit, StaticLiquidContainer.FillIntoContainer, StaticLiquidContainer.IsCompatibleWithOtherContainer, AutoContainerLid.ContentLevelChanged, LiquidGradualDrinker.containerDrinkingFrom, LiquidGradualDrinker.HandleLiquidContainer, PlayerDrinkingMouth.container, PlayerDrinkingMouth.LiquidAmountChanged, PotionVisuals.container.