Package org.cha0scollective.wwpg.api
Record Class TickContext
java.lang.Object
java.lang.Record
org.cha0scollective.wwpg.api.TickContext
Authoritative server electrical timestep. gameTime is the dimension's game
tick; tickSeconds is the simulated duration, independent of wall-clock lag.
substeps is the PG schedule for this tick. Substep duration is tickSeconds/substeps.
-
Constructor Summary
ConstructorsConstructorDescriptionTickContext(long gameTime, double tickSeconds, int substeps) Creates an instance of aTickContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longgameTime()Returns the value of thegameTimerecord component.final inthashCode()Returns a hash code value for this object.doubleAbsolute simulated time at the start of this tick, for source waveforms.intsubsteps()Returns the value of thesubstepsrecord component.doubleDuration of each accepted electrical substep in simulated seconds.doubleReturns the value of thetickSecondsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TickContext
public TickContext(long gameTime, double tickSeconds, int substeps) Creates an instance of aTickContextrecord class.- Parameters:
gameTime- the value for thegameTimerecord componenttickSeconds- the value for thetickSecondsrecord componentsubsteps- the value for thesubstepsrecord component
-
-
Method Details
-
substepSeconds
public double substepSeconds()Duration of each accepted electrical substep in simulated seconds. -
startTimeSeconds
public double startTimeSeconds()Absolute simulated time at the start of this tick, for source waveforms. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
gameTime
public long gameTime()Returns the value of thegameTimerecord component.- Returns:
- the value of the
gameTimerecord component
-
tickSeconds
public double tickSeconds()Returns the value of thetickSecondsrecord component.- Returns:
- the value of the
tickSecondsrecord component
-
substeps
public int substeps()Returns the value of thesubstepsrecord component.- Returns:
- the value of the
substepsrecord component
-