Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
    • Constructor Detail

      • Animations

        public Animations()
    • 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 enclosing FreeColClient.
        unit - The Unit to be animated.
        source - The source Tile for the unit.
        destination - The destination Tile for the unit.
        scale - The scale factor for the unit image.
        Returns:
        A list of Animations.
      • getAttackAnimationBase

        private static java.lang.String getAttackAnimationBase​(Unit unit)
        Get the base resource identifier for an attack animation.
        Parameters:
        unit - The attacking Unit.
        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 enclosing FreeColClient.
        attacker - The Unit that is attacking.
        defender - The Unit that is defending.
        attackerTile - The Tile the attack comes from.
        defenderTile - The Tile the attack goes to.
        success - Did the attack succeed?
        scale - The scale factor for the unit image.
        Returns:
        A list of Animations.