de.rico.adventure.conversation
Class Conversation

java.lang.Object
  extended by de.rico.adventure.conversation.Conversation

public class Conversation
extends java.lang.Object

This class represents a conversation between the player and a non-player-character (NPC) based on a question and answer system. The player can choose a question from a list menu that triggers a series of sentences spoken by the participants of the conversation.

Author:
Frank Bruns

Constructor Summary
Conversation(java.lang.String id, Chapter chapter, InputManager input)
          Creates a new conversation with the specified parameters.
 
Method Summary
 void addBranch(Branch branch)
          Adds a branch to the conversation.
 void draw(javax.media.opengl.GL gl)
          Draws the questions dialog to the screen.
 Branch getBranch(java.lang.String id)
          Returns the branch with the specified branch id.
 java.lang.String getScriptId()
          Returns the script id of the conversation.
 void start()
          Starts the conversation.
 void update(long elapsedTime)
          Updates the conversation object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conversation

public Conversation(java.lang.String id,
                    Chapter chapter,
                    InputManager input)
Creates a new conversation with the specified parameters.

Parameters:
id - script id of the conversation
chapter - the chapter this conversation belongs to
input - input manager object
Method Detail

getScriptId

public java.lang.String getScriptId()
Returns the script id of the conversation.

Returns:
script id of the conversation

addBranch

public void addBranch(Branch branch)
Adds a branch to the conversation.

Parameters:
branch - branch to add

getBranch

public Branch getBranch(java.lang.String id)
Returns the branch with the specified branch id.

Parameters:
id - id of the branch to retrieve
Returns:
branch with the specified id

start

public void start()
Starts the conversation.


update

public void update(long elapsedTime)
Updates the conversation object.

Parameters:
elapsedTime - time between two frames

draw

public void draw(javax.media.opengl.GL gl)
Draws the questions dialog to the screen.

Parameters:
gl -