Record Class CatchUpPolicy
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.CatchUpPolicy
- Record Components:
maxTicks- most unloaded ticks that are caught up; 0 means none (frozen in time)
What a machine does about the time it spent unloaded (D4, ARCHITECTURE.md ยง18).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CatchUpPolicyFrozen in time while unloaded: resumes exactly where it stopped. -
Constructor Summary
ConstructorsConstructorDescriptionCatchUpPolicy(long maxTicks) Creates an instance of aCatchUpPolicyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CatchUpPolicybounded(long maxTicks) On load,MachineBehavior.catchUp(MachineContext, long)receives the ticks spent unloaded, capped atmaxTicks.booleanfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longmaxTicks()Returns the value of themaxTicksrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
Frozen in time while unloaded: resumes exactly where it stopped. The default.
-
-
Constructor Details
-
CatchUpPolicy
public CatchUpPolicy(long maxTicks) Creates an instance of aCatchUpPolicyrecord class.- Parameters:
maxTicks- the value for themaxTicksrecord component
-
-
Method Details
-
bounded
On load,MachineBehavior.catchUp(MachineContext, long)receives the ticks spent unloaded, capped atmaxTicks. The behavior must work in one step, with its own storages only. -
catchesUp
public boolean catchesUp() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
maxTicks
-