RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.dialogue.OptionDialogue Class Reference

The Chainable implementation that represents a dialogue in which options are given to the player. More...

Inheritance diagram for com.runehive.content.dialogue.OptionDialogue:
Collaboration diagram for com.runehive.content.dialogue.OptionDialogue:

Public Member Functions

void accept (DialogueFactory factory)
List< Runnable > getActions ()
 Gets the list of actions for this dialogue.
String[] getLines ()
 Gets the text for this dialogue.
 OptionDialogue (String option1, Runnable action1, String option2, Runnable action2)
 Creates a new OptionDialogue.
 OptionDialogue (String option1, Runnable action1, String option2, Runnable action2, String option3, Runnable action3)
 Creates a new OptionDialogue.
 OptionDialogue (String option1, Runnable action1, String option2, Runnable action2, String option3, Runnable action3, String option4, Runnable action4)
 Creates a new OptionDialogue.
 OptionDialogue (String option1, Runnable action1, String option2, Runnable action2, String option3, Runnable action3, String option4, Runnable action4, String option5, Runnable action5)
 Creates a new OptionDialogue.

Private Attributes

final List< Runnable > actions = new ArrayList<>()
 The list of actions for this dialogue.
final String[] lines
 The text for this dialogue.

Detailed Description

The Chainable implementation that represents a dialogue in which options are given to the player.

Author
Michael | Chex

Definition at line 11 of file OptionDialogue.java.

Constructor & Destructor Documentation

◆ OptionDialogue() [1/4]

com.runehive.content.dialogue.OptionDialogue.OptionDialogue ( String option1,
Runnable action1,
String option2,
Runnable action2 )

Creates a new OptionDialogue.

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 27 of file OptionDialogue.java.

27 {
28 lines = new String[]{option1, option2};
29 actions.add(action1);
30 actions.add(action2);
31 }

References actions, and lines.

◆ OptionDialogue() [2/4]

com.runehive.content.dialogue.OptionDialogue.OptionDialogue ( String option1,
Runnable action1,
String option2,
Runnable action2,
String option3,
Runnable action3 )

Creates a new OptionDialogue.

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 43 of file OptionDialogue.java.

43 {
44 lines = new String[]{option1, option2, option3};
45 actions.add(action1);
46 actions.add(action2);
47 actions.add(action3);
48 }

References actions, and lines.

◆ OptionDialogue() [3/4]

com.runehive.content.dialogue.OptionDialogue.OptionDialogue ( String option1,
Runnable action1,
String option2,
Runnable action2,
String option3,
Runnable action3,
String option4,
Runnable action4 )

Creates a new OptionDialogue.

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 62 of file OptionDialogue.java.

62 {
63 lines = new String[]{option1, option2, option3, option4};
64 actions.add(action1);
65 actions.add(action2);
66 actions.add(action3);
67 actions.add(action4);
68 }

References actions, and lines.

◆ OptionDialogue() [4/4]

com.runehive.content.dialogue.OptionDialogue.OptionDialogue ( String option1,
Runnable action1,
String option2,
Runnable action2,
String option3,
Runnable action3,
String option4,
Runnable action4,
String option5,
Runnable action5 )

Creates a new OptionDialogue.

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 84 of file OptionDialogue.java.

84 {
85 lines = new String[]{option1, option2, option3, option4, option5};
86 actions.add(action1);
87 actions.add(action2);
88 actions.add(action3);
89 actions.add(action4);
90 actions.add(action5);
91 }

References actions, and lines.

Member Function Documentation

◆ accept()

void com.runehive.content.dialogue.OptionDialogue.accept ( DialogueFactory factory)

Definition at line 94 of file OptionDialogue.java.

94 {
95 factory.sendOption(this);
96 }

References com.runehive.content.dialogue.DialogueFactory.sendOption().

Here is the call graph for this function:

◆ getActions()

List< Runnable > com.runehive.content.dialogue.OptionDialogue.getActions ( )

Gets the list of actions for this dialogue.

Returns
The list of actions.

Definition at line 112 of file OptionDialogue.java.

112 {
113 return actions;
114 }

References actions.

Referenced by com.runehive.content.dialogue.DialogueFactory.executeOption().

Here is the caller graph for this function:

◆ getLines()

String[] com.runehive.content.dialogue.OptionDialogue.getLines ( )

Gets the text for this dialogue.

Returns
The text.

Definition at line 103 of file OptionDialogue.java.

103 {
104 return lines;
105 }

References lines.

Member Data Documentation

◆ actions

final List<Runnable> com.runehive.content.dialogue.OptionDialogue.actions = new ArrayList<>()
private

The list of actions for this dialogue.

Definition at line 17 of file OptionDialogue.java.

Referenced by getActions(), OptionDialogue(), OptionDialogue(), OptionDialogue(), and OptionDialogue().

◆ lines

final String [] com.runehive.content.dialogue.OptionDialogue.lines
private

The text for this dialogue.

Definition at line 14 of file OptionDialogue.java.

Referenced by getLines(), OptionDialogue(), OptionDialogue(), OptionDialogue(), and OptionDialogue().


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