class ConsoleDialogueManager
extends java.lang.Object
First of the two parts that make up my ConsoleDialogueAPI, a lightweight programming interface for creating console dialogues.
Abbreviations you might encounter in this documentation:
CDM = ConsoleDialogueManager
CDE = ConsoleDialogueElement
Modifier and Type | Field | Description |
---|---|---|
private static List<CDE> |
activeCDEs |
List that hold all the active CDEs + the order they "check" in.
|
private static java.lang.String |
activeHelpMessage |
The message shown by the default help CDE.
|
private static java.lang.String |
activeInitialMessage |
The currently active initial message.
|
private List<CDE> |
cdElements |
This instance's CDEs + a variable for potentially backing up previously active CDEs.
|
private List<CDE> |
cdElementsBackup |
This instance's CDEs + a variable for potentially backing up previously active CDEs.
|
private static CDE |
help |
The default help CDE.
|
private static java.lang.String |
HELP_PATTERN |
The regex string defining the pattern used for matching by the default help CDE.
|
private java.lang.String |
helpMessage |
This instance's help message + a variable for potentially backing up a previously active help message.
|
private java.lang.String |
helpMessageBackup |
This instance's help message + a variable for potentially backing up a previously active help message.
|
private java.lang.String |
initalMessage |
Holds instance-specific "initial message" - a message shown at the creation of an CDM
+ a variable for potentially backing up a previously active inital message.
|
private java.lang.String |
initialMessageBackup |
Holds instance-specific "initial message" - a message shown at the creation of an CDM
+ a variable for potentially backing up a previously active inital message.
|
private static java.lang.String |
input |
String that holds what is in this documentation referred to as the user input.
|
private static java.util.Scanner |
scanner |
Scanner -object for fetching what the user types in the terminal.
|
private static java.lang.String |
UNABLE_TO_INTERPRET_MESSAGE |
The default message shown when user input didn't match any of the patterns defined in the CDEs.
|
Constructor | Description |
---|---|
< class="memberNameLink">ConsoleDialogueManager(java.util.List<ConsoleDialogueElement> cdElements,
java.lang.String initialMessage,
java.lang.String helpMessage,
boolean queue,
boolean merge) |
CDM Constructor
|
Modifier and Type | Method | Description |
---|---|---|
private void |
CollapseCD() |
CollapseCD
|
private void |
ConsoleDialogue() |
ConsoleDialogue
|
private void |
InitializeCD(boolean queue,
boolean merge) |
InitializeCD
|
private static java.util.List<ConsoleDialogueElement> activeCDEs
private static java.lang.String activeHelpMessage
private static java.lang.String activeInitialMessage
private java.util.List<ConsoleDialogueElement> cdElements
private java.util.List<ConsoleDialogueElement> cdElementsBackup
private static final ConsoleDialogueElement help
private static final java.lang.String HELP_PATTERN
private java.lang.String helpMessage
private java.lang.String helpMessageBackup
private java.lang.String initalMessage
private java.lang.String initialMessageBackup
private static java.lang.String input
private static final java.util.Scanner scanner
private static final java.lang.String UNABLE_TO_INTERPRET_MESSAGE
ConsoleDialogueManager(java.util.List<ConsoleDialogueElement> cdElements, java.lang.String initialMessage, java.lang.String helpMessage, boolean queue, boolean merge)
cdElements
- a List containing the CDEsinitialMessage
- a string that will be the CDM's initial messagehelpMessage
- a string that will be set as the CDM's help messagequeue
- boolean that, if set to true, tells the CDM to just queue up the CDEs and then move on with the code, rather than start the dialogue immediatelymerge
- boolean that if set to true, tells the CDM to not replace the "queue", but rather add on top of what was already thereprivate void CollapseCD()
private void ConsoleDialogue()
private void InitializeCD(boolean queue, boolean merge)
queue
- boolean that, if set to true, tells the CDM to just queue up the CDEs and then move on with the code, rather than start the dialogue immediately (forwarded from constructor)merge
- boolean that if set to true, tells the CDM to not replace the "queue", but rather add on top of what was already there (forwarded from constructor)