A class in Root.Township, Alta.Liquid.
One pour in progress from a source liquid container into a receiving one. Progress builds up and each time it reaches 1, one unit of liquid moves over.
Constructors
Fields
5 private and internal fields
| Member | What it is |
|---|
private ILiquidTransitionController currentController | The controller that set the current target. Only it can progress or reset the pour. |
private bool isDuringTransitionFinishing | True while OnTransitionFinished runs, so the reset inside the fill is ignored. |
private static Logger logger | NLog logger for this class. |
private ILiquidContainer receivingContainer | Backing field for ReceivingContainer, the container being poured into, or null. |
private ILiquidContainer sourceContainer | Backing field for SourceContainer, the container being poured from. |
Properties
| Member | What it is |
|---|
bool IsFinished { get; internal set; } | True once the transfer ended, was cancelled or the target was removed. |
float Progress { get; private set; } | How far the current unit has got, from 0 to 1. |
ILiquidContainer ReceivingContainer { get; } | The container being poured into, or null when there's no target. |
ILiquidContainer SourceContainer { get; } | The container pouring. |
Events
| Member | What it is |
|---|
event Action<LiquidTransition> TransitionCancelled | Raised when the target changes before finishing, or the target's liquid stops being compatible. |
event Action TransitionFinished | Raised after a unit of liquid was moved. |
event Action TransitionStarted | Raised when a new target is set. |
Methods
| Member | What it is |
|---|
void ProgressTransition(float transitionProgress, ILiquidTransitionController controller) | Adds progress, scaled by the target's receive multiplier and the global liquid speed. Ignored unless called by the current controller. |
void ResetAndRemoveReceivingContainer(ILiquidTransitionController controller) | Clears the target and progress and marks the pour finished, if called by the current controller. |
void SetTarget(ILiquidContainer newReceivingContainer, ILiquidTransitionController controller) | Starts pouring into a new compatible container, cancelling any pour to a previous one. |
2 private and internal methods
| Member | What it is |
|---|
private void CheckIfTransitionIsStillValid(LiquidContent oldType, LiquidContent newType) | When the receiving container's liquid changes, cancels the pour if the two containers no longer mix. |
private void OnTransitionFinished() | Moves one unit of liquid into the receiving container if it isn't full, then clears the target. |
Used in
Members of other types that take, return or hold a LiquidTransition:
ILiquidContainerInternal.AddLiquidInTransition, ILiquidContainerInternal.OutTransition, ILiquidContainerInternal.RemoveLiquidInTransition, LiquidContainer.AddLiquidInTransition, LiquidContainer.Alta.Liquid.ILiquidContainerInternal.OutTransition, LiquidContainer.ClearContainedLiquidDueToFailedTransition, LiquidContainer.inTransitions, LiquidContainer.outTransition, LiquidContainer.RemoveLiquidInTransition, LiquidContainer.sortedInTransitions, StaticLiquidContainer.AddLiquidInTransition, StaticLiquidContainer.Alta.Liquid.ILiquidContainerInternal.OutTransition, StaticLiquidContainer.RemoveLiquidInTransition.