Class FlameBall

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class FlameBall
    extends ComputerFigure
    Simple computer figure that lets every point around him explode with an energy a fifth of the Flameballs current energy.
    See Also:
    Serialized Form
    • Constructor Detail

      • FlameBall

        public FlameBall​(Game game,
                         FigureInfo figureInfo)
        Creates a FlameBall.
        Parameters:
        game - The game.
        figureInfo - The figure info.
    • Method Detail

      • onAddHeat

        public int onAddHeat​(int heat,
                             boolean internal,
                             Thing source)
        Returns 0 - Flameball is immune to heat.
        Overrides:
        onAddHeat in class Figure
        Parameters:
        heat - The heat to add. Negative value decreases heat.
        internal - Flag, if heat comes from inside figure.
        source - The source of the heat gain.
        Returns:
        0
      • onBeforeRemoveEnergy

        protected int onBeforeRemoveEnergy​(int min,
                                           Thing source,
                                           DieReason reason,
                                           AnimationInfo animation)
        Called before energy is removed from figure. Returns 0 if this figure is the source of the loss.
        Overrides:
        onBeforeRemoveEnergy in class Figure
        Parameters:
        min - The energy loss.
        source - The source.
        reason - The reason.
        animation - The AnimationInfo.
        Returns:
        The modified energy loss.
      • doSpecialUpdate

        protected void doSpecialUpdate​(AnimationInfo animation)
        This method is called at the end of the regular updateThing()-method. Lets all surrounding points explode.
        Overrides:
        doSpecialUpdate in class ComputerFigure
        Parameters:
        animation - The AnimationInfo.
      • entersExplosion

        protected boolean entersExplosion()
        Checks, fi the figure wants to enter explosions. It does always (because they're mostly self-made).
        Overrides:
        entersExplosion in class ComputerFigure
        Returns:
        true