net.sf.freecol.client.gui.animation
Class UnitAttackAnimation
java.lang.Object
net.sf.freecol.client.gui.animation.UnitAttackAnimation
final class UnitAttackAnimation
- extends java.lang.Object
Class for the animation of units attacks.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
attacker
private final Unit attacker
defender
private final Unit defender
success
private final boolean success
gui
private GUI gui
freeColClient
private FreeColClient freeColClient
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?
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.