Record Class LinearCurveFactory.DynamicLinearCurve

java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.func.curve.LinearCurveFactory.DynamicLinearCurve
All Implemented Interfaces:
CurveFunction.LevelCurveData
Enclosing class:
LinearCurveFactory

public static record LinearCurveFactory.DynamicLinearCurve(float minX, float maxX, LevelFunction y0, LevelFunction y1, float[] xs, LevelFunction[] ys) extends Record implements CurveFunction.LevelCurveData
  • Constructor Summary

    Constructors
    Constructor
    Description
    DynamicLinearCurve(float[] xs, LevelFunction[] ys)
     
    DynamicLinearCurve(float minX, float maxX, LevelFunction y0, LevelFunction y1, float[] xs, LevelFunction[] ys)
    Creates an instance of a DynamicLinearCurve record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    get(float x, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
     
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the maxX record component.
    float
    Returns the value of the minX record component.
    final String
    Returns a string representation of this record class.
    float[]
    xs()
    Returns the value of the xs record component.
    y0()
    Returns the value of the y0 record component.
    y1()
    Returns the value of the y1 record component.
    ys()
    Returns the value of the ys record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DynamicLinearCurve

      public DynamicLinearCurve(float[] xs, LevelFunction[] ys)
    • DynamicLinearCurve

      public DynamicLinearCurve(float minX, float maxX, LevelFunction y0, LevelFunction y1, float[] xs, LevelFunction[] ys)
      Creates an instance of a DynamicLinearCurve record class.
      Parameters:
      minX - the value for the minX record component
      maxX - the value for the maxX record component
      y0 - the value for the y0 record component
      y1 - the value for the y1 record component
      xs - the value for the xs record component
      ys - the value for the ys record component
  • Method Details

    • get

      public float get(float x, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Specified by:
      get in interface CurveFunction.LevelCurveData
    • 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 '=='.
      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.
    • minX

      public float minX()
      Returns the value of the minX record component.
      Returns:
      the value of the minX record component
    • maxX

      public float maxX()
      Returns the value of the maxX record component.
      Returns:
      the value of the maxX record component
    • y0

      public LevelFunction y0()
      Returns the value of the y0 record component.
      Returns:
      the value of the y0 record component
    • y1

      public LevelFunction y1()
      Returns the value of the y1 record component.
      Returns:
      the value of the y1 record component
    • xs

      public float[] xs()
      Returns the value of the xs record component.
      Returns:
      the value of the xs record component
    • ys

      public LevelFunction[] ys()
      Returns the value of the ys record component.
      Returns:
      the value of the ys record component