Record Class Hitmark

java.lang.Object
java.lang.Record
dev.twilite.game.wrapper.Hitmark
Record Components:
type - hitmark type id
damage - displayed damage amount
expiryCycle - client cycle associated with the hitmark expiry

public record Hitmark(int type, int damage, int expiryCycle) extends Record
A visible hitmark on an actor.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Hitmark(int type, int damage, int expiryCycle)
    Creates an instance of a Hitmark record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
    Returns the value of the damage record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the expiryCycle record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns whether this hitmark is one of the local-player damage/block categories.
    boolean
    Returns whether this hitmark is one of the other-player damage/block categories.
    int
    Returns remaining game ticks until this hitmark cycle expires.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

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

    • Hitmark

      public Hitmark(int type, int damage, int expiryCycle)
      Creates an instance of a Hitmark record class.
      Parameters:
      type - the value for the type record component
      damage - the value for the damage record component
      expiryCycle - the value for the expiryCycle record component
  • Method Details

    • category

      public Hitmark.Category category()
    • remaining

      public int remaining()
      Returns remaining game ticks until this hitmark cycle expires.
    • mine

      public boolean mine()
      Returns whether this hitmark is one of the local-player damage/block categories.
    • others

      public boolean others()
      Returns whether this hitmark is one of the other-player damage/block categories.
    • 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. All components in this record class 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.
    • type

      public int type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • damage

      public int damage()
      Returns the value of the damage record component.
      Returns:
      the value of the damage record component
    • expiryCycle

      public int expiryCycle()
      Returns the value of the expiryCycle record component.
      Returns:
      the value of the expiryCycle record component