de.rico.adventure.conversation
Class Sentence

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

public class Sentence
extends java.lang.Object

This class is a container for one ore more sentences of text to be said by a character.

Author:
Frank Bruns

Constructor Summary
Sentence(AbstractCharacter c, java.lang.String text)
          Creates a new sentence object with the specified text, but without a sound file assigned.
Sentence(AbstractCharacter c, java.lang.String text, java.lang.String pathSound)
          Creates a new sentence object with the specified text and the speciefied sound file.
 
Method Summary
 AbstractCharacter getCharacter()
          Returns the character that is assigned to this sentence.
 java.lang.String getScriptCode()
          Returns the scripted code that is assigned to the sentence.
 Mp3Sound getSound()
          Returns the sound that is assigned to this Sentence object.
 java.lang.String getText()
          Returns the text assigned to this Sentence object.
 boolean isRunning()
          Determines whether or not this sentence is currently running.
 void reloadSound()
          A method that reloads the sound file associated to this sentence.
 void setScriptCode(java.lang.String code)
          Assigns the specified scripted code to the sentence
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sentence

public Sentence(AbstractCharacter c,
                java.lang.String text)
Creates a new sentence object with the specified text, but without a sound file assigned.

Parameters:
c - character that sais the sentence
text - text for this sentence object

Sentence

public Sentence(AbstractCharacter c,
                java.lang.String text,
                java.lang.String pathSound)
Creates a new sentence object with the specified text and the speciefied sound file.

Parameters:
c - character that sais the sentence
text - text for this sentence object
pathSound - path to mp3 sound file
Method Detail

setScriptCode

public void setScriptCode(java.lang.String code)
Assigns the specified scripted code to the sentence

Parameters:
code - scripted code that is connected to the sentence

getScriptCode

public java.lang.String getScriptCode()
Returns the scripted code that is assigned to the sentence. If none is available the method returns null.

Returns:
scripted code that is connected to the sentence

getCharacter

public AbstractCharacter getCharacter()
Returns the character that is assigned to this sentence.

Returns:
character of the sentence

getText

public java.lang.String getText()
Returns the text assigned to this Sentence object.

Returns:
text of this Sentence object

getSound

public Mp3Sound getSound()
Returns the sound that is assigned to this Sentence object.

Returns:
sound of this Sentence object

reloadSound

public void reloadSound()
A method that reloads the sound file associated to this sentence.


isRunning

public boolean isRunning()
Determines whether or not this sentence is currently running.

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