Class Answer.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • setAnswerID

      public Answer.Builder setAnswerID(String answerID)
      Sets the unique ID of this answer.
      Parameters:
      answerID - answer identifier
      Returns:
      this builder for chaining
    • setAnswerText

      public Answer.Builder setAnswerText(String answerText)
      Sets the visible text of this answer.
      Parameters:
      answerText - text to display
      Returns:
      this builder for chaining
    • setGoTo

      public Answer.Builder setGoTo(List<String> goTo)
      Sets the page IDs to navigate to when this answer is selected.
      Parameters:
      goTo - list of page IDs
      Returns:
      this builder for chaining
    • addReplyMessage

      public Answer.Builder addReplyMessage(String message)
      Adds a reply chat/message sent when this answer is selected.
      Parameters:
      message - reply message
      Returns:
      this builder for chaining
    • setSound

      public Answer.Builder setSound(String sound, String soundSource, Double soundVolume, Double soundPitch)
      Configures the sound played when this answer is selected.
      Parameters:
      sound - sound name
      soundSource - sound source
      soundVolume - volume (0.0–1.0)
      soundPitch - pitch
      Returns:
      this builder for chaining
    • addCondition

      public Answer.Builder addCondition(String condition)
      Adds a condition required for this answer to be available.
      Parameters:
      condition - condition string, implementation specific
      Returns:
      this builder for chaining
    • addAction

      public Answer.Builder addAction(String action)
      Adds an action executed when this answer is selected.
      Parameters:
      action - action string, implementation specific
      Returns:
      this builder for chaining
    • addCallback

      public Answer.Builder addCallback(DialogueCallback callback)
      Adds a callback invoked when this answer is selected.
      Parameters:
      callback - callback to invoke
      Returns:
      this builder for chaining
    • build

      public Answer build()
      Builds the Answer instance.
      Returns:
      built answer