net.sf.freecol.client.gui.animation
Class UnitAttackAnimation

java.lang.Object
  extended by net.sf.freecol.client.gui.animation.UnitAttackAnimation

final class UnitAttackAnimation
extends java.lang.Object

Class for the animation of units attacks.


Field Summary
private  Unit attacker
           
private  Unit defender
           
private  FreeColClient freeColClient
           
private  GUI gui
           
private  boolean success
           
 
Constructor Summary
UnitAttackAnimation(FreeColClient freeColClient, GUI gui, Unit attacker, Unit defender, boolean success)
          Build a new attack animation.
 
Method Summary
 void animate()
          Do the animation.
private  SimpleZippedAnimation getAnimation(Unit unit, Map.Direction direction)
          Find the animation for a unit attack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attacker

private final Unit attacker

defender

private final Unit defender

success

private final boolean success

gui

private GUI gui

freeColClient

private FreeColClient freeColClient
Constructor Detail

UnitAttackAnimation

public UnitAttackAnimation(FreeColClient freeColClient,
                           GUI gui,
                           Unit attacker,
                           Unit defender,
                           boolean success)
Build a new attack animation.

Parameters:
canvas - The Canvas to draw the animation on.
attacker - The Unit that is attacking.
defender - The Unit that is defending.
success - Does the attack succeed?
Method Detail

getAnimation

private SimpleZippedAnimation getAnimation(Unit unit,
                                           Map.Direction direction)
Find the animation for a unit attack.

Parameters:
unit - The Unit to animate.
direction - The Direction of the attack.
Returns:
An animation, if available.

animate

public void animate()
Do the animation.