de.rico.adventure.conversation
Class Branch

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

public class Branch
extends java.lang.Object

A branch encapsulates the series of sentences that get spoken after the player chose a question from the conversation list menu.

Author:
Frank Bruns

Constructor Summary
Branch(java.lang.String id, java.lang.String title, boolean available)
          Creates a new conversation branch with the specified parameters.
 
Method Summary
 void addSentence(Sentence sent)
          Adds a Sentence object to the branch.
 java.lang.String getId()
          Returns the id of the branch.
 java.util.List<Sentence> getSentences()
          Returns the list of sentences of this branch.
 java.lang.String getTitle()
          Returns the title of the branch which is the text that gets displayed in the conversation's dialog list menu for choosing the branch.
 boolean hasBeenSaid()
          Determines whether or not this branch has been marked to have been said before.
 boolean isAvailable()
          Determines whether or not this branch is (already) available for a conversation.
 void markAsSaid()
          Marks this branch as been said.
 void setAvailable(boolean available)
          Sets whethter or not this branch is available for a conversation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Branch

public Branch(java.lang.String id,
              java.lang.String title,
              boolean available)
Creates a new conversation branch with the specified parameters.

Parameters:
id - internal id of the branch
title - tile of the branch (, will be display in the list menu)
available - is branch initially available? --> true=yes, false=no
Method Detail

addSentence

public void addSentence(Sentence sent)
Adds a Sentence object to the branch.

Parameters:
sent - Sentence object

getSentences

public java.util.List<Sentence> getSentences()
Returns the list of sentences of this branch.

Returns:
list of sentences

getId

public java.lang.String getId()
Returns the id of the branch.

Returns:
branch id

getTitle

public java.lang.String getTitle()
Returns the title of the branch which is the text that gets displayed in the conversation's dialog list menu for choosing the branch.

Returns:
title of the branch

isAvailable

public boolean isAvailable()
Determines whether or not this branch is (already) available for a conversation.

Returns:
is available? --> true=yes, false=no

hasBeenSaid

public boolean hasBeenSaid()
Determines whether or not this branch has been marked to have been said before.

Returns:
has branch been said before? --> true=yes, false=no

markAsSaid

public void markAsSaid()
Marks this branch as been said.


setAvailable

public void setAvailable(boolean available)
Sets whethter or not this branch is available for a conversation.

Parameters:
available - set available? --> true=yes, false=no