Record Class HudLink

java.lang.Object
java.lang.Record
dev.boze.api.gui.hud.HudLink
Record Components:
target - The target's title, or its stored name while it is missing
active - Whether the element is following the target right now
fromX - The attached point of this element
fromY - The attached point of this element
toX - The point it is attached to, the same as fromX while not active
toY - The point it is attached to, the same as fromY while not active

public record HudLink(String target, boolean active, double fromX, double fromY, double toX, double toY) extends Record
An element's attachment to another element, in GUI-scaled pixels. While the target is off or missing, the element stays at its own screen anchor and keeps the link for when the target returns.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HudLink(String target, boolean active, double fromX, double fromY, double toX, double toY)
    Creates an instance of a HudLink record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the active record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Returns the value of the fromX record component.
    double
    Returns the value of the fromY record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the target record component.
    final String
    Returns a string representation of this record class.
    double
    toX()
    Returns the value of the toX record component.
    double
    toY()
    Returns the value of the toY record component.

    Methods inherited from class Object

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

    • HudLink

      public HudLink(String target, boolean active, double fromX, double fromY, double toX, double toY)
      Creates an instance of a HudLink record class.
      Parameters:
      target - the value for the target record component
      active - the value for the active record component
      fromX - the value for the fromX record component
      fromY - the value for the fromY record component
      toX - the value for the toX record component
      toY - the value for the toY record component
  • Method Details

    • 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.
    • target

      public String target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • active

      public boolean active()
      Returns the value of the active record component.
      Returns:
      the value of the active record component
    • fromX

      public double fromX()
      Returns the value of the fromX record component.
      Returns:
      the value of the fromX record component
    • fromY

      public double fromY()
      Returns the value of the fromY record component.
      Returns:
      the value of the fromY record component
    • toX

      public double toX()
      Returns the value of the toX record component.
      Returns:
      the value of the toX record component
    • toY

      public double toY()
      Returns the value of the toY record component.
      Returns:
      the value of the toY record component