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
ConstructorsConstructorDescriptionDynamicLinearCurve(float[] xs, LevelFunction[] ys) DynamicLinearCurve(float minX, float maxX, LevelFunction y0, LevelFunction y1, float[] xs, LevelFunction[] ys) Creates an instance of aDynamicLinearCurverecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.floatget(float x, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) final inthashCode()Returns a hash code value for this object.floatmaxX()Returns the value of themaxXrecord component.floatminX()Returns the value of theminXrecord component.final StringtoString()Returns a string representation of this record class.float[]xs()Returns the value of thexsrecord component.y0()Returns the value of they0record component.y1()Returns the value of they1record component.ys()Returns the value of theysrecord component.
-
Constructor Details
-
DynamicLinearCurve
-
DynamicLinearCurve
public DynamicLinearCurve(float minX, float maxX, LevelFunction y0, LevelFunction y1, float[] xs, LevelFunction[] ys) Creates an instance of aDynamicLinearCurverecord class.- Parameters:
minX- the value for theminXrecord componentmaxX- the value for themaxXrecord componenty0- the value for they0record componenty1- the value for they1record componentxs- the value for thexsrecord componentys- the value for theysrecord component
-
-
Method Details
-
get
public float get(float x, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) - Specified by:
getin interfaceCurveFunction.LevelCurveData
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
minX
public float minX()Returns the value of theminXrecord component.- Returns:
- the value of the
minXrecord component
-
maxX
public float maxX()Returns the value of themaxXrecord component.- Returns:
- the value of the
maxXrecord component
-
y0
Returns the value of they0record component.- Returns:
- the value of the
y0record component
-
y1
Returns the value of they1record component.- Returns:
- the value of the
y1record component
-
xs
public float[] xs()Returns the value of thexsrecord component.- Returns:
- the value of the
xsrecord component
-
ys
Returns the value of theysrecord component.- Returns:
- the value of the
ysrecord component
-