bluegammon.gui.animation
Class WinnerAnim

java.lang.Object
  extended bybluegammon.gui.animation.Animation
      extended bybluegammon.gui.animation.WinnerAnim

public class WinnerAnim
extends Animation

Animation for indicating a winner. Spawns subanimations of flying pieces.

Author:
Peter Andersson
See Also:
WinnerPieceMoveAnim

Constructor Summary
WinnerAnim(boolean white, int piecesLeft, int pts)
          Creates a new winner animation.
 
Method Summary
 long getInterval()
          Returns interval time in milliseconds when the animation should be updated, i.e. the next method is invoked.
 boolean isFinished()
          Probes to check if the animation can be removed
 void next()
          Called each time the animation should be updated.
 void paint(javax.microedition.lcdui.Graphics g)
          Draws the animation using the specified graphics context.
 void piecePlus()
          Called from WinnerPieceMoveAnim when the piece has flyed beyond the screen.
 
Methods inherited from class bluegammon.gui.animation.Animation
callNext, getLastInvoke, onExit, onStart
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WinnerAnim

public WinnerAnim(boolean white,
                  int piecesLeft,
                  int pts)
Creates a new winner animation.

Parameters:
white - True for white winner, false for black winner.
piecesLeft - Number of loser pieces left.
pts - Number of points per piece.
Method Detail

paint

public void paint(javax.microedition.lcdui.Graphics g)
Description copied from class: Animation
Draws the animation using the specified graphics context.

Specified by:
paint in class Animation
Parameters:
g - The graphics context.

next

public void next()
Description copied from class: Animation
Called each time the animation should be updated.

Specified by:
next in class Animation

isFinished

public boolean isFinished()
Description copied from class: Animation
Probes to check if the animation can be removed

Specified by:
isFinished in class Animation
Returns:
true if finished, false if still active

getInterval

public long getInterval()
Description copied from class: Animation
Returns interval time in milliseconds when the animation should be updated, i.e. the next method is invoked.

Specified by:
getInterval in class Animation
Returns:
update interval in milliseconds.

piecePlus

public void piecePlus()
Called from WinnerPieceMoveAnim when the piece has flyed beyond the screen. Updates the score count.