RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
com.osroyale.content.dialogue.DialogueFactory Class Reference

Public Member Functions

 DialogueFactory (Player player)
final DialogueFactory sendDialogue (Dialogue dialogue)
final DialogueFactory onAction (Runnable action)
DialogueFactory onNext ()
final DialogueFactory executeOption (int type, Optional< OptionDialogue > result)
void clear ()
final Queue< ChainablegetChain ()
boolean isOption ()
final DialogueFactory execute ()
final DialogueFactory sendPlayerChat (String... lines)
final DialogueFactory sendPlayerChat (Expression expression, String... lines)
final DialogueFactory sendNpcChat (int id, String... lines)
final DialogueFactory sendNpcChat (int id, Expression expression, String... lines)
final DialogueFactory sendOption (String option1, Runnable action1, String option2, Runnable action2)
final DialogueFactory sendOption (String option1, Runnable action1, String option2, Runnable action2, String option3, Runnable action3)
final DialogueFactory sendOption (String option1, Runnable action1, String option2, Runnable action2, String option3, Runnable action3, String option4, Runnable action4)
final DialogueFactory sendOption (String option1, Runnable action1, String option2, Runnable action2, String option3, Runnable action3, String option4, Runnable action4, String option5, Runnable action5)
final DialogueFactory sendStatement (String... lines)
Player getPlayer ()
Optional< Runnable > getNextAction ()
void setNextAction (Optional< Runnable > nextAction)

Detailed Description

/**

Definition at line 56 of file DialogueFactory.java.

Constructor & Destructor Documentation

◆ DialogueFactory()

com.osroyale.content.dialogue.DialogueFactory.DialogueFactory ( Player player)
inline

Creates a new DialogueFactory.

Parameters
playerThe player who owns this factory.

Definition at line 81 of file DialogueFactory.java.

Member Function Documentation

◆ clear()

void com.osroyale.content.dialogue.DialogueFactory.clear ( )
inline

Clears the current dialogue chain.

Returns
The instance of this factory.

Definition at line 152 of file DialogueFactory.java.

◆ execute()

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.execute ( )
inline

Retrieves the next dialogue in the chain and executes it.

Returns
The instance of this factory.

Definition at line 196 of file DialogueFactory.java.

◆ executeOption()

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.executeOption ( int type,
Optional< OptionDialogue > result )
inline

Executes an result for a player.

Parameters
typeThe type of option.
resultThe option to execute.

Definition at line 133 of file DialogueFactory.java.

◆ getChain()

final Queue< Chainable > com.osroyale.content.dialogue.DialogueFactory.getChain ( )
inline

Gets the current chain.

Returns
The queue of dialogues.

Definition at line 177 of file DialogueFactory.java.

◆ getNextAction()

Optional< Runnable > com.osroyale.content.dialogue.DialogueFactory.getNextAction ( )
inline

Gets the Optional describing the next action in the dialogue chain.

Returns
The optional describing the next action.

Definition at line 678 of file DialogueFactory.java.

◆ getPlayer()

Player com.osroyale.content.dialogue.DialogueFactory.getPlayer ( )
inline

The player that owns this factory.

Returns
The player.

Definition at line 668 of file DialogueFactory.java.

◆ isOption()

boolean com.osroyale.content.dialogue.DialogueFactory.isOption ( )
inline

Gets if the dialogue is option.

Returns
The option dialogue.

Definition at line 186 of file DialogueFactory.java.

◆ onAction()

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.onAction ( Runnable action)
inline

Sets an action so this action can be executed after dialogues are done.

Parameters
actionThe action to set.
Returns
The instance of this factory.

Definition at line 103 of file DialogueFactory.java.

◆ onNext()

DialogueFactory com.osroyale.content.dialogue.DialogueFactory.onNext ( )
inline

Accepts the next dialogue in the chain.

Returns
The instance of this factory.

Definition at line 117 of file DialogueFactory.java.

◆ sendDialogue()

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendDialogue ( Dialogue dialogue)
inline

Sends a player a dialogue.

Parameters
dialogueThe dialogue to sent.

Definition at line 90 of file DialogueFactory.java.

◆ sendNpcChat() [1/2]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendNpcChat ( int id,
Expression expression,
String... lines )
inline

Appends an NpcDialogue to the current dialogue chain.

Parameters
idThe id of this npc.
expressionThe expression of this npc.
linesThe text of this dialogue.
Returns
The instance of this factory.

Definition at line 345 of file DialogueFactory.java.

◆ sendNpcChat() [2/2]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendNpcChat ( int id,
String... lines )
inline

Appends an NpcDialogue to the current dialogue chain.

Parameters
idThe id of this npc.
linesThe text of this dialogue.
Returns
The instance of this factory.

Definition at line 333 of file DialogueFactory.java.

◆ sendOption() [1/4]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendOption ( String option1,
Runnable action1,
String option2,
Runnable action2 )
inline

Appends the OptionDialogue onto the current dialogue chain.

Parameters
option1The text for the first option.
action1The action for the first action.
option2The text for the second option.
action2The action for the second action.

Definition at line 413 of file DialogueFactory.java.

◆ sendOption() [2/4]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendOption ( String option1,
Runnable action1,
String option2,
Runnable action2,
String option3,
Runnable action3 )
inline

Appends the OptionDialogue onto the current dialogue chain.

Parameters
option1The text for the first option.
action1The action for the first action.
option2The text for the second option.
action2The action for the second action.
option3The text for the third option.
action3The action for the third action.

Definition at line 427 of file DialogueFactory.java.

◆ sendOption() [3/4]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendOption ( String option1,
Runnable action1,
String option2,
Runnable action2,
String option3,
Runnable action3,
String option4,
Runnable action4 )
inline

Appends the OptionDialogue onto the current dialogue chain.

Parameters
option1The text for the first option.
action1The action for the first action.
option2The text for the second option.
action2The action for the second action.
option3The text for the third option.
action3The action for the third action.
option4The text for the four option.
action4The action for the four action.

Definition at line 443 of file DialogueFactory.java.

◆ sendOption() [4/4]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendOption ( String option1,
Runnable action1,
String option2,
Runnable action2,
String option3,
Runnable action3,
String option4,
Runnable action4,
String option5,
Runnable action5 )
inline

Appends the OptionDialogue onto the current dialogue chain.

Parameters
option1The text for the first option.
action1The action for the first action.
option2The text for the second option.
action2The action for the second action.
option3The text for the third option.
action3The action for the third action.
option4The text for the four option.
action4The action for the four action.
option5The text for the fifth option.
action5The action for the fifth action.

Definition at line 461 of file DialogueFactory.java.

◆ sendPlayerChat() [1/2]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendPlayerChat ( Expression expression,
String... lines )
inline

Appends a PlayerDialogue to the current dialogue chain.

Parameters
linesThe dialogue of the player talking.
expressionThe expression of this dialogue.
Returns
The instance of this factory.

Definition at line 270 of file DialogueFactory.java.

◆ sendPlayerChat() [2/2]

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendPlayerChat ( String... lines)
inline

Appends a PlayerDialogue to the current dialogue chain.

Parameters
linesThe dialogue of the player talking.
Returns
The instance of this factory.

Definition at line 259 of file DialogueFactory.java.

◆ sendStatement()

final DialogueFactory com.osroyale.content.dialogue.DialogueFactory.sendStatement ( String... lines)
inline

Appends a StatementDialogue to the current dialogue chain.

Parameters
linesThe text for this statement.
Returns
The instance of this factory.

Definition at line 529 of file DialogueFactory.java.

◆ setNextAction()

void com.osroyale.content.dialogue.DialogueFactory.setNextAction ( Optional< Runnable > nextAction)
inline

Sets the next action in the dialogue chain.

Parameters
nextActionThe action to set.

Definition at line 687 of file DialogueFactory.java.


The documentation for this class was generated from the following file: