Record Class NetworkView
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.network.NetworkView
- Record Components:
transports- loaded transport blocks in the networkendpoints- attached machine ports, asposition sidemovedLastTick- what the last network tick moved
public record NetworkView(@NotNull NetworkType type, @NotNull Set<WorldPosition> transports, @NotNull List<String> endpoints, long ratePerTick, boolean active, long movedLastTick)
extends Record
Snapshot of a network for inspection (ยง27).
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkView(@NotNull NetworkType type, @NotNull Set<WorldPosition> transports, @NotNull List<String> endpoints, long ratePerTick, boolean active, long movedLastTick) Creates an instance of aNetworkViewrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns the value of theactiverecord component.Returns the value of theendpointsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of themovedLastTickrecord component.longReturns the value of theratePerTickrecord component.final StringtoString()Returns a string representation of this record class.@NotNull Set<WorldPosition> Returns the value of thetransportsrecord component.@NotNull NetworkTypetype()Returns the value of thetyperecord component.
-
Constructor Details
-
NetworkView
public NetworkView(@NotNull @NotNull NetworkType type, @NotNull @NotNull Set<WorldPosition> transports, @NotNull @NotNull List<String> endpoints, long ratePerTick, boolean active, long movedLastTick) Creates an instance of aNetworkViewrecord class.- Parameters:
type- the value for thetyperecord componenttransports- the value for thetransportsrecord componentendpoints- the value for theendpointsrecord componentratePerTick- the value for theratePerTickrecord componentactive- the value for theactiverecord componentmovedLastTick- the value for themovedLastTickrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
transports
Returns the value of thetransportsrecord component.- Returns:
- the value of the
transportsrecord component
-
endpoints
-
ratePerTick
public long ratePerTick()Returns the value of theratePerTickrecord component.- Returns:
- the value of the
ratePerTickrecord component
-
active
public boolean active()Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-
movedLastTick
public long movedLastTick()Returns the value of themovedLastTickrecord component.- Returns:
- the value of the
movedLastTickrecord component
-