com.threerings.puzzle.drop.client
Class PieceGroupAnimation

java.lang.Object
  extended by com.threerings.media.AbstractMedia
      extended by com.threerings.media.animation.Animation
          extended by com.threerings.puzzle.drop.client.PieceGroupAnimation
All Implemented Interfaces:
com.threerings.media.sprite.PathObserver, Shape

public abstract class PieceGroupAnimation
extends com.threerings.media.animation.Animation
implements com.threerings.media.sprite.PathObserver

Animates all the pieces on a puzzle board doing some sort of global effect like all flying into place or out into the ether.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.media.animation.Animation
com.threerings.media.animation.Animation.AnimCompletedOp, com.threerings.media.animation.Animation.AnimStartedOp
 
Field Summary
protected  DropBoard _board
           
protected  int _penders
           
protected  com.threerings.media.sprite.Sprite[] _sprites
           
protected  DropBoardView _view
           
 
Fields inherited from class com.threerings.media.animation.Animation
_finished
 
Fields inherited from class com.threerings.media.AbstractMedia
_bounds, _firstTick, _mgr, _observers, _renderOrder, HUD_LAYER
 
Constructor Summary
PieceGroupAnimation(DropBoardView view, DropBoard board)
          Creates a piece group animation which must be initialized with a subsequent call to AbstractMedia.init(AbstractMediaManager).
 
Method Summary
protected abstract  void configureSprite(com.threerings.media.sprite.Sprite sprite, int xx, int yy)
          An animation must override this method to configure each sprite with a path, potentially a render order, and whatever other configurations are needed.
 void paint(Graphics2D gfx)
           
 void pathCancelled(com.threerings.media.sprite.Sprite sprite, com.threerings.media.util.Path path)
           
 void pathCompleted(com.threerings.media.sprite.Sprite sprite, com.threerings.media.util.Path path, long when)
           
 void tick(long tickStamp)
           
protected  void willStart(long tickStamp)
           
 
Methods inherited from class com.threerings.media.animation.Animation
addAnimationObserver, didFinish, isFinished, removeAnimationObserver, reset, setLocation, willFinish
 
Methods inherited from class com.threerings.media.AbstractMedia
addObserver, contains, contains, contains, contains, fastForward, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, init, intersects, intersects, invalidate, invalidateAfterChange, naturalCompareTo, queueNotification, removeObserver, renderCompareTo, setRenderOrder, shutdown, toString, toString, viewLocationDidChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_view

protected DropBoardView _view

_board

protected DropBoard _board

_sprites

protected com.threerings.media.sprite.Sprite[] _sprites

_penders

protected int _penders
Constructor Detail

PieceGroupAnimation

public PieceGroupAnimation(DropBoardView view,
                           DropBoard board)
Creates a piece group animation which must be initialized with a subsequent call to AbstractMedia.init(AbstractMediaManager).

Method Detail

tick

public void tick(long tickStamp)
Specified by:
tick in class com.threerings.media.AbstractMedia

paint

public void paint(Graphics2D gfx)
Specified by:
paint in class com.threerings.media.AbstractMedia

pathCancelled

public void pathCancelled(com.threerings.media.sprite.Sprite sprite,
                          com.threerings.media.util.Path path)
Specified by:
pathCancelled in interface com.threerings.media.sprite.PathObserver

pathCompleted

public void pathCompleted(com.threerings.media.sprite.Sprite sprite,
                          com.threerings.media.util.Path path,
                          long when)
Specified by:
pathCompleted in interface com.threerings.media.sprite.PathObserver

willStart

protected void willStart(long tickStamp)
Overrides:
willStart in class com.threerings.media.animation.Animation

configureSprite

protected abstract void configureSprite(com.threerings.media.sprite.Sprite sprite,
                                        int xx,
                                        int yy)
An animation must override this method to configure each sprite with a path, potentially a render order, and whatever other configurations are needed.