Class Page.Builder

java.lang.Object
org.aselstudios.luxdialoguesapi.Builders.Page.Builder
Enclosing class:
Page

public static class Page.Builder extends Object
Builder for Page instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setID

      public Page.Builder setID(String id)
      Sets the unique ID of this page.
      Parameters:
      id - page identifier
      Returns:
      this builder for chaining
    • setTimer

      public Page.Builder setTimer(Integer ticks)
      Sets the automatic page timer.
      Parameters:
      ticks - time in ticks before auto-advancing, or null for none
      Returns:
      this builder for chaining
    • setGoTo

      public Page.Builder setGoTo(List<String> goTo)
      Sets the default page IDs to go to when this page completes.
      Parameters:
      goTo - list of page IDs
      Returns:
      this builder for chaining
    • addLine

      public Page.Builder addLine(String line)
      Adds a dialogue line to this page.
      Parameters:
      line - line of text to display
      Returns:
      this builder for chaining
    • setTypingInfoLine

      public Page.Builder setTypingInfoLine(String typingInfoLine)
      Adds a line that is shown while text is typing.
      Parameters:
      typingInfoLine - info line text
      Returns:
      this builder for chaining
    • setSteadyInfoLine

      public Page.Builder setSteadyInfoLine(String steadyInfoLine)
      Adds a line that is shown once typing has completed.
      Parameters:
      steadyInfoLine - info line text
      Returns:
      this builder for chaining
    • addPreAction

      public Page.Builder addPreAction(String action)
      Adds an action to be executed before the page is shown.
      Parameters:
      action - action string, implementation specific
      Returns:
      this builder for chaining
    • addPostAction

      public Page.Builder addPostAction(String action)
      Adds an action to be executed after the page completes.
      Parameters:
      action - action string, implementation specific
      Returns:
      this builder for chaining
    • addExitAction

      public Page.Builder addExitAction(String action)
      Adds an action to be executed when the dialogue exits from this page.
      Parameters:
      action - action string, implementation specific
      Returns:
      this builder for chaining
    • addPreCallback

      public Page.Builder addPreCallback(DialogueCallback callback)
      Adds a callback to be invoked before the page is shown.
      Parameters:
      callback - callback to invoke
      Returns:
      this builder for chaining
    • addPostCallback

      public Page.Builder addPostCallback(DialogueCallback callback)
      Adds a callback to be invoked after the page completes.
      Parameters:
      callback - callback to invoke
      Returns:
      this builder for chaining
    • addExitCallback

      public Page.Builder addExitCallback(DialogueCallback callback)
      Adds a callback to be invoked when the dialogue exits from this page.
      Parameters:
      callback - callback to invoke
      Returns:
      this builder for chaining
    • addAnswer

      public Page.Builder addAnswer(Answer answer)
      Adds an answer option to this page.
      Parameters:
      answer - answer definition
      Returns:
      this builder for chaining
    • build

      public Page build()
      Builds the Page instance.
      Returns:
      built page
      Throws:
      IllegalStateException - if required fields are missing