RuneHive-Game
Loading...
Searching...
No Matches
Dialogue.java
Go to the documentation of this file.
1package com.runehive.content.dialogue;
2
3import com.google.common.collect.ImmutableList;
4
5/**
6 * Represents an abstract dialogue, in which extending classes will be able to construct and send dialogues
7 * to a player.
8 *
9 * @author Seven
10 */
11public abstract class Dialogue {
12
13 /** The action buttons responsible for dialogues. */
14 public static final ImmutableList<Integer> DIALOGUE_BUTTONS = ImmutableList.of(2461, 2471, 2482, 2462, 2472, 2483, 2473, 2484, 2485, 2494, 2495, 2496, 2497, 2498);
15
16 /**
17 * Sends a player a dialogue.
18 *
19 * @param factory The factory for this dialogue.
20 */
21 public abstract void sendDialogues(DialogueFactory factory);
22
23
24 /**
25 * Checks if the button triggered is an optional dialogue button.
26 *
27 * @param button The index of the button being checked.
28 * @return The result of the operation.
29 */
30 public static final boolean isDialogueButton(int button) {
31 return DIALOGUE_BUTTONS.stream().anyMatch(search -> DIALOGUE_BUTTONS.contains(button));
32 }
33}
Represents a factory class that contains important functions for building dialogues.
Represents an abstract dialogue, in which extending classes will be able to construct and send dialog...
Definition Dialogue.java:11
abstract void sendDialogues(DialogueFactory factory)
Sends a player a dialogue.
static final boolean isDialogueButton(int button)
Checks if the button triggered is an optional dialogue button.
Definition Dialogue.java:30
static final ImmutableList< Integer > DIALOGUE_BUTTONS
The action buttons responsible for dialogues.
Definition Dialogue.java:14