RuneHive-Game
Loading...
Searching...
No Matches
ItemDialogue.java
Go to the documentation of this file.
1package com.runehive.content.dialogue;
2
3/**
4 * Handles the item on dialogue.
5 *
6 * @author Daniel
7 */
8public class ItemDialogue implements Chainable {
9
10 /** The title of the item dialogue. */
11 private final String title;
12
13 /** The context of the item dialogue. */
14 private final String context;
15
16 /** The item being displayed on the dialogue. */
17 private final int item;
18
19 /**
20 * Constructs a new <code>ItemDialogue</code>.
21 *
22 * @param title The title of the dialogue.
23 * @param context The context of the dialogue.
24 * @param item The item being displayed on the dialogue.
25 */
26 public ItemDialogue(String title, String context, int item) {
27 this.title = title;
28 this.context = context;
29 this.item = item;
30 }
31
32 /**
33 * Gets the title of the dialogue.
34 *
35 * @return The dialogue title.
36 */
37 public String getTitle() {
38 return title;
39 }
40
41 /**
42 * Gets the context of the dialogue.
43 *
44 * @return The dialogue context.
45 */
46 public String getContext() {
47 return context;
48 }
49
50 /**
51 * Gets the item display of the dialogue.
52 *
53 * @return The item being displayed on the dialogue.
54 */
55 public int getItem() {
56 return item;
57 }
58
59 @Override
60 public void accept(DialogueFactory factory) {
61 factory.sendItem(this);
62 }
63}
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory sendItem(String title, String text, Item item)
final String title
The title of the item dialogue.
String getTitle()
Gets the title of the dialogue.
ItemDialogue(String title, String context, int item)
Constructs a new ItemDialogue.
void accept(DialogueFactory factory)
int getItem()
Gets the item display of the dialogue.
final int item
The item being displayed on the dialogue.
final String context
The context of the item dialogue.
String getContext()
Gets the context of the dialogue.
The chain-able itemcontainer that allows implementing dialogue factories the ability to chain togethe...