Record Class FishProperties.SizeAndWeight

java.lang.Object
java.lang.Record
com.wdiscute.starcatcher.registry.FishProperties.SizeAndWeight
Enclosing class:
FishProperties

public static record FishProperties.SizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation, float goldenChance) extends Record
  • Field Details

  • Constructor Details

    • SizeAndWeight

      public SizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation)
    • SizeAndWeight

      public SizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation, float goldenChance)
      Creates an instance of a SizeAndWeight record class.
      Parameters:
      sizeAverage - the value for the sizeAverage record component
      sizeDeviation - the value for the sizeDeviation record component
      weightAverage - the value for the weightAverage record component
      weightDeviation - the value for the weightDeviation record component
      goldenChance - the value for the goldenChance record component
  • Method Details

    • getRandomSize

      public static int getRandomSize(FishProperties fp, float percentile)
    • getRandomWeight

      public static int getRandomWeight(FishProperties fp, float percentile)
    • 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.
    • sizeAverage

      public float sizeAverage()
      Returns the value of the sizeAverage record component.
      Returns:
      the value of the sizeAverage record component
    • sizeDeviation

      public float sizeDeviation()
      Returns the value of the sizeDeviation record component.
      Returns:
      the value of the sizeDeviation record component
    • weightAverage

      public float weightAverage()
      Returns the value of the weightAverage record component.
      Returns:
      the value of the weightAverage record component
    • weightDeviation

      public float weightDeviation()
      Returns the value of the weightDeviation record component.
      Returns:
      the value of the weightDeviation record component
    • goldenChance

      public float goldenChance()
      Returns the value of the goldenChance record component.
      Returns:
      the value of the goldenChance record component