Record Class StatPanelLayout
java.lang.Object
java.lang.Record
me.desht.pneumaticcraft.api.client.pneumatic_helmet.StatPanelLayout
- Record Components:
x- X position, in range 0..1y- Y position, in range 0..1isLeftSided- true if panel is anchored to the left, false is anchored to the right
Represents a resolution-independent position for an armor HUD stat panel
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStatPanelLayout(float x, float y, boolean isLeftSided) Creates an instance of aStatPanelLayoutrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static StatPanelLayoutfromJson(com.google.gson.JsonObject obj) final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisLeftSidedrecord component.com.google.gson.JsonObjecttoJson()final StringtoString()Returns a string representation of this record class.floatx()Returns the value of thexrecord component.floaty()Returns the value of theyrecord component.
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
StatPanelLayout
public StatPanelLayout(float x, float y, boolean isLeftSided) Creates an instance of aStatPanelLayoutrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentisLeftSided- the value for theisLeftSidedrecord component
-
-
Method Details
-
toJson
public com.google.gson.JsonObject toJson() -
fromJson
-
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 '=='. -
x
public float x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public float y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
isLeftSided
public boolean isLeftSided()Returns the value of theisLeftSidedrecord component.- Returns:
- the value of the
isLeftSidedrecord component
-