public class ConversationManagement
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ConversationManagement.QuestionStage
This is the enumeration for the different stages of questioning the NPC
|
Modifier and Type | Field and Description |
---|---|
private Player |
player
The player that will be starting the conversation
|
private ScoreTracker |
scoreTracker |
private SpeechboxManager |
speechboxMngr
The manager for speechboxes, controls the flow of speechboxes
|
private int |
tempCluePos
This stores the position of the clue in the players list for use in the questioning
|
private NPC |
tempNPC
Stores the current NPC that is being questioned
|
private AbstractPerson.Personality |
tempQuestionStyle
This stores the style of questioning for how the player wants to ask the question
|
Constructor and Description |
---|
ConversationManagement(Player player,
SpeechboxManager speechboxManager,
ScoreTracker scoreTracker)
This constructs a conversation manager.
|
Modifier and Type | Method and Description |
---|---|
private void |
accuseNPC()
This method initialises an accusing user interface
|
private AbstractPerson.Personality |
convertToQuestionStyle(int style)
Takes an int and returns a personality style
|
private void |
finishConverstation()
This method is called when a conversation is over to change some variables back for normal gameplay to resume
|
private void |
handleResponse(ConversationManagement.QuestionStage stage,
int option)
This method is called to handle a users input
|
private void |
queryQuestionStyle()
This constructs the speechbox that asks the player how they wish to ask the question
|
private void |
queryQuestionType()
This constructs the speech box that finds out what question the player wishes to ask the NPC
|
private void |
queryWhichClue()
This constructs the speechbox that asks the player what clue they wish to ask about
|
private void |
questionNPC()
This method initialises a questioning user interface
|
void |
startConversation(NPC npc)
This method starts a conversation with the specified NPC
|
private Player player
private SpeechboxManager speechboxMngr
private NPC tempNPC
private int tempCluePos
private AbstractPerson.Personality tempQuestionStyle
private ScoreTracker scoreTracker
public ConversationManagement(Player player, SpeechboxManager speechboxManager, ScoreTracker scoreTracker)
player
- The player that will initiate the conversation.speechboxManager
- The speechbox manager that displays the conversation.scoreTracker
- The score tracker to update where appropriate.public void startConversation(NPC npc)
npc
- - The NPC to have a conversation withprivate void queryQuestionType()
private void queryQuestionStyle()
private void queryWhichClue()
private void questionNPC()
private void accuseNPC()
private void finishConverstation()
private void handleResponse(ConversationManagement.QuestionStage stage, int option)
stage
- - The stage of the questioning process that they are currently atoption
- - The option chosen by the userprivate AbstractPerson.Personality convertToQuestionStyle(int style)
style
- 0 = Nice
1 = Neutral
2 = AGGRESSIVE
default is Neutral