Record Class QuestPageElement

java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.page.QuestPageElement
All Implemented Interfaces:
GuidePage

public record QuestPageElement(List<GuideObjective> objectives, Optional<String> title, String text, Optional<String> reward) extends Record implements GuidePage
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.ixdarklord.folios.api.client.page.GuidePage

    GuidePage.Laid, GuidePage.Part, GuidePage.SpreadHalf
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<QuestPageElement>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    QuestPageElement(List<GuideObjective> objectives, Optional<String> title, String text, Optional<String> reward)
    Creates an instance of a QuestPageElement record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    bar(GuidePainter painter, int x, int y, int width, int height, float fill, int color)
    A bar of a given fill (0 to 1) in a colour, drawn as pixel art.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static void
    gilded(GuidePainter painter, int x, int y, int width, float fill)
    The mastery bar, 7 pixels tall from (x, y), kin to the build guide's but its own: a soft shadow under it and to its right; a gilt rim, lighter along its top and darker along its foot, its corners rounded off and nothing standing past it; a dark groove with a faint light line along its floor; the filled length in the book's colour (green once full), lit along its top, shaded along its foot and banded with fine slanting stripes, a glint at its end; and quarters marked by gilt dividers inside the groove.
    final int
    Returns a hash code value for this object.
    lay(GuideLayout layout)
    Sets the page out: one or more pages, each drawn on its own.
    Returns the value of the objectives record component.
    Returns the value of the reward record component.
    Words of the page a search should find it by.
    static void
    stepped(GuidePainter painter, int x, int y, int width, float fill, int steps, int color)
    A bar of steps parts, as a category's entries or a quest's objectives, 5 pixels tall from (x, y): a rim with its corners rounded off, a sunken groove notched between the parts, and the filled length lit along its top and shaded along its foot, a glint at its end.
    Returns the value of the text record component.
    Returns the value of the title record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.ixdarklord.folios.api.client.page.GuidePage

    items, spread
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<QuestPageElement> CODEC
  • Constructor Details

    • QuestPageElement

      public QuestPageElement(List<GuideObjective> objectives, Optional<String> title, String text, Optional<String> reward)
      Creates an instance of a QuestPageElement record class.
      Parameters:
      objectives - the value for the objectives record component
      title - the value for the title record component
      text - the value for the text record component
      reward - the value for the reward record component
  • Method Details

    • lay

      public List<GuidePage.Laid> lay(GuideLayout layout)
      Description copied from interface: GuidePage
      Sets the page out: one or more pages, each drawn on its own.
      Specified by:
      lay in interface GuidePage
    • gilded

      public static void gilded(GuidePainter painter, int x, int y, int width, float fill)
      The mastery bar, 7 pixels tall from (x, y), kin to the build guide's but its own: a soft shadow under it and to its right; a gilt rim, lighter along its top and darker along its foot, its corners rounded off and nothing standing past it; a dark groove with a faint light line along its floor; the filled length in the book's colour (green once full), lit along its top, shaded along its foot and banded with fine slanting stripes, a glint at its end; and quarters marked by gilt dividers inside the groove.
    • stepped

      public static void stepped(GuidePainter painter, int x, int y, int width, float fill, int steps, int color)
      A bar of steps parts, as a category's entries or a quest's objectives, 5 pixels tall from (x, y): a rim with its corners rounded off, a sunken groove notched between the parts, and the filled length lit along its top and shaded along its foot, a glint at its end. Once full it shows color with a light sweeping across it now and then.
    • bar

      public static void bar(GuidePainter painter, int x, int y, int width, int height, float fill, int color)
      A bar of a given fill (0 to 1) in a colour, drawn as pixel art. Four or more pixels tall: a dark rim round it with its corners clipped, a sunk track, the fill lit along its top and shaded along its foot, notched every few pixels like a gauge, with a bright cap at its leading edge. Thinner: a dashed line of the colour on its track.
    • objectives

      public List<GuideObjective> objectives()
      Returns the value of the objectives record component.
      Specified by:
      objectives in interface GuidePage
      Returns:
      the value of the objectives record component
    • searchText

      public String searchText()
      Description copied from interface: GuidePage
      Words of the page a search should find it by.
      Specified by:
      searchText in interface GuidePage
    • 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 Objects::equals(Object,Object).
      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.
    • title

      public Optional<String> title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • reward

      public Optional<String> reward()
      Returns the value of the reward record component.
      Returns:
      the value of the reward record component