RuneHive-Game
Loading...
Searching...
No Matches
PlayerDialogue.java
Go to the documentation of this file.
1package com.runehive.content.dialogue;
2
3/**
4 * A {@link Chainable} implementation that represents a player talking.
5 *
6 * @author Seven
7 */
8public class PlayerDialogue implements Chainable {
9
10 /** The expression of this player. */
11 private final Expression expression;
12
13 /** The text for this dialogue. */
14 private final String[] lines;
15
16 /**
17 * Creates a new {@link PlayerDialogue} with a default expression of {@code DEFAULT}.
18 *
19 * @param lines The text for this dialogue.
20 */
21 public PlayerDialogue(String... lines) {
23 }
24
25 /**
26 * Creates a new {@link PlayerDialogue}.
27 *
28 * @param expression The expression for this dialogue.
29 * @param lines The text for this dialogue.
30 */
32 this.expression = expression;
33 this.lines = lines;
34 }
35
36 /**
37 * Gets the expression of this player.
38 *
39 * @return The expression of this player.
40 */
42 return expression;
43 }
44
45 /**
46 * Gets the text for this dialogue.
47 *
48 * @return The text.
49 */
50 public String[] getLines() {
51 return lines;
52 }
53
54 @Override
55 public void accept(DialogueFactory factory) {
56 factory.sendPlayerChat(this);
57 }
58}
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory sendPlayerChat(String... lines)
Appends a PlayerDialogue to the current dialogue chain.
Expression getExpression()
Gets the expression of this player.
PlayerDialogue(String... lines)
Creates a new PlayerDialogue with a default expression of DEFAULT.
String[] getLines()
Gets the text for this dialogue.
PlayerDialogue(Expression expression, String... lines)
Creates a new PlayerDialogue.
final String[] lines
The text for this dialogue.
final Expression expression
The expression of this player.
Represents the expressions of entities for dialogue.
The chain-able itemcontainer that allows implementing dialogue factories the ability to chain togethe...