Class Animations
- java.lang.Object
-
- net.sf.freecol.client.gui.animation.Animations
-
public class Animations extends java.lang.Object
A facade for animations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Animations.Procedure
Trivial wrapper for zero-argument-zero-return function, used as a callback for an animation to trigger painting.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description Animations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
getAttackAnimationBase(Unit unit)
Get the base resource identifier for an attack animation.static java.util.List<Animation>
unitAttack(FreeColClient freeColClient, Unit attacker, Unit defender, Tile attackerTile, Tile defenderTile, boolean success, float scale)
Collection animations for a unit attack.static java.util.List<Animation>
unitMove(FreeColClient freeColClient, Unit unit, Tile source, Tile destination, float scale)
Collect animations for a unit move.
-
-
-
Method Detail
-
unitMove
public static java.util.List<Animation> unitMove(FreeColClient freeColClient, Unit unit, Tile source, Tile destination, float scale)
Collect animations for a unit move.- Parameters:
freeColClient
- The enclosingFreeColClient
.unit
- TheUnit
to be animated.source
- The sourceTile
for the unit.destination
- The destinationTile
for the unit.scale
- The scale factor for the unit image.- Returns:
- A list of
Animation
s.
-
getAttackAnimationBase
private static java.lang.String getAttackAnimationBase(Unit unit)
Get the base resource identifier for an attack animation.- Parameters:
unit
- The attackingUnit
.- Returns:
- The resource base exclusive of direction.
-
unitAttack
public static java.util.List<Animation> unitAttack(FreeColClient freeColClient, Unit attacker, Unit defender, Tile attackerTile, Tile defenderTile, boolean success, float scale)
Collection animations for a unit attack.- Parameters:
freeColClient
- The enclosingFreeColClient
.attacker
- TheUnit
that is attacking.defender
- TheUnit
that is defending.attackerTile
- TheTile
the attack comes from.defenderTile
- TheTile
the attack goes to.success
- Did the attack succeed?scale
- The scale factor for the unit image.- Returns:
- A list of
Animation
s.
-
-