Record Class ProcessView

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.process.ProcessView
Record Components:
recipe - key of the recipe being processed
status - current status
progress - ticks done
duration - ticks needed (modifiers applied at start)
inFlight - inputs consumed at start and held until completion (D15)
outputs - what completion produces (captured at start)
costPerTick - per-tick costs (modifiers applied at start)

public record ProcessView(@NotNull net.kyori.adventure.key.Key recipe, @NotNull ProcessStatus status, long progress, long duration, @NotNull List<ResourceStack> inFlight, @NotNull List<ResourceStack> outputs, @NotNull List<ResourceStack> costPerTick) extends Record
Read-only view of a running process (ARCHITECTURE.md ยง13).
  • Constructor Details

    • ProcessView

      public ProcessView(@NotNull @NotNull net.kyori.adventure.key.Key recipe, @NotNull @NotNull ProcessStatus status, long progress, long duration, @NotNull @NotNull List<ResourceStack> inFlight, @NotNull @NotNull List<ResourceStack> outputs, @NotNull @NotNull List<ResourceStack> costPerTick)
      Creates an instance of a ProcessView record class.
      Parameters:
      recipe - the value for the recipe record component
      status - the value for the status record component
      progress - the value for the progress record component
      duration - the value for the duration record component
      inFlight - the value for the inFlight record component
      outputs - the value for the outputs record component
      costPerTick - the value for the costPerTick record component
  • Method Details

    • remaining

      public long remaining()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • recipe

      @NotNull public @NotNull net.kyori.adventure.key.Key recipe()
      Returns the value of the recipe record component.
      Returns:
      the value of the recipe record component
    • status

      @NotNull public @NotNull ProcessStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • progress

      public long progress()
      Returns the value of the progress record component.
      Returns:
      the value of the progress record component
    • duration

      public long duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • inFlight

      @NotNull public @NotNull List<ResourceStack> inFlight()
      Returns the value of the inFlight record component.
      Returns:
      the value of the inFlight record component
    • outputs

      @NotNull public @NotNull List<ResourceStack> outputs()
      Returns the value of the outputs record component.
      Returns:
      the value of the outputs record component
    • costPerTick

      @NotNull public @NotNull List<ResourceStack> costPerTick()
      Returns the value of the costPerTick record component.
      Returns:
      the value of the costPerTick record component