gameaction
Class Talk

java.lang.Object
  extended by gameaction.AbstractGameAction
      extended by gameaction.Talk
All Implemented Interfaces:
java.io.Serializable

public class Talk
extends AbstractGameAction

A game action that represents talking to a character

Author:
Frank Bruns
See Also:
Serialized Form

Constructor Summary
Talk(AbstractCharacterSprite c, boolean isBranch)
          Creates a new Talk action
Talk(AbstractCharacterSprite c, boolean isBranch, boolean aborter)
          Creates a new Talk action
 
Method Summary
 SentenceScheduler getSentenceScheduler()
          Returns the global sentence scheduler
 boolean isAborter()
          Determines whether this talk actions is the aborter for a dialog
 boolean isNoMoreToSay()
          Determines whether there are no more sentences in the sentences scheduler
 void render(java.awt.Graphics2D g)
           
 void say(AbstractCharacterSprite c, java.lang.String line)
          Lets the character say a sentence.
 void say(AbstractCharacterSprite c, java.lang.String[] lines)
          Deprecated. do not use this method anymore
 void say(AbstractCharacterSprite c, java.lang.String line, java.awt.Color color)
          Lets the character say a sentence with the specified color.
 void say(AbstractCharacterSprite c, java.lang.String line, java.awt.Color color, int time)
          Lets the character say a sentence with the specified color
 void say(AbstractCharacterSprite c, java.lang.String line, int time)
          Lets the character say a sentence
 void say(AbstractCharacterSprite c, java.lang.String line, java.lang.String soundPath)
          Lets the character say a sentence with the specified sound file
 void say(AbstractCharacterSprite c, java.lang.String line, java.lang.String soundPath, java.awt.Color color)
          Lets the character say a sentence with the specified color and specified sound file
 void update(long elapsedTime)
          Updates the game action
 
Methods inherited from class gameaction.AbstractGameAction
getCharacter, isSecondMethodCall
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Talk

public Talk(AbstractCharacterSprite c,
            boolean isBranch)
Creates a new Talk action

Parameters:
c - character to whose game action queue the talk action shall be assigned to
isBranch - specifies, if the talk action is part of a dialog with a question selection area

Talk

public Talk(AbstractCharacterSprite c,
            boolean isBranch,
            boolean aborter)
Creates a new Talk action

Parameters:
c - character to whose game action queue the talk action shall be assigned to
isBranch - specifies, if the talk action is part of a dialog with a question selection area
aborter - specifies if the talk action is used to abort dialogs with question selection areas
Method Detail

isAborter

public boolean isAborter()
Determines whether this talk actions is the aborter for a dialog

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

getSentenceScheduler

public SentenceScheduler getSentenceScheduler()
Returns the global sentence scheduler

Returns:
the sentence scheduler

isNoMoreToSay

public boolean isNoMoreToSay()
Determines whether there are no more sentences in the sentences scheduler

Returns:
nothing more to say? --> true=yes, false=no

say

public void say(AbstractCharacterSprite c,
                java.lang.String line,
                java.lang.String soundPath,
                java.awt.Color color)
Lets the character say a sentence with the specified color and specified sound file

Parameters:
c - the character that says something
line - sentence to be said
color - color of the sentence's text
soundPath - path+filename for corresponding sound file

say

public void say(AbstractCharacterSprite c,
                java.lang.String line,
                java.awt.Color color,
                int time)
Lets the character say a sentence with the specified color

Parameters:
c - the character that says something
line - sentence to be said
color - color of the sentence's text
time - time in ms the line is visible

say

public void say(AbstractCharacterSprite c,
                java.lang.String line,
                java.lang.String soundPath)
Lets the character say a sentence with the specified sound file

Parameters:
c - character that says something
line - sentence to be said
soundPath - path+filename for corresponding sound file

say

public void say(AbstractCharacterSprite c,
                java.lang.String line,
                int time)
Lets the character say a sentence

Parameters:
c - character that says something
line - sentence to be said
time - time in ms the line is visible

say

public void say(AbstractCharacterSprite c,
                java.lang.String line)
Lets the character say a sentence. The duration time for displaying the sentence varies by the number of characters in the sentence. A longer sentence logically means a longer time of display

Parameters:
c - character that says something
line - sentence to be said

say

public void say(AbstractCharacterSprite c,
                java.lang.String[] lines)
Deprecated. do not use this method anymore

Lets the character say a sentence.
Note: This method cannot be called directly from beanshell scripts

Parameters:
c - character that says something
lines - one or several sentences to be said

say

public void say(AbstractCharacterSprite c,
                java.lang.String line,
                java.awt.Color color)
Lets the character say a sentence with the specified color. The duration time for displaying the sentence varies by the number of characters in the sentence. A longer sentence logically means a longer time of display.

Parameters:
c - character that says something
line - sentence to be said
color - color of the sentence's text

update

public void update(long elapsedTime)
Description copied from class: AbstractGameAction
Updates the game action

Specified by:
update in class AbstractGameAction
Parameters:
elapsedTime - time between two frames

render

public void render(java.awt.Graphics2D g)