Class ItemRock

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

    public class ItemRock
    extends Item
    implements ItemRammable
    Item that blocks the point it occupies. Undestroyable.
    See Also:
    Serialized Form
    • Constructor Detail

      • ItemRock

        public ItemRock()
        Creates a new ItemRock.
    • Method Detail

      • getItemRating

        public int getItemRating()
        Returns an item value for ComputerFigures rating in the items category.
        Overrides:
        getItemRating in class Item
        Returns:
        -10000.
      • getImageName

        public java.lang.String getImageName​(AnimationInfo animation)
        Returns image name.
        Overrides:
        getImageName in class Thing
        Parameters:
        animation - The AnimationInfo.
        Returns:
        "item_rock"+imgIndex
      • getRamPower

        public int getRamPower()
        Gets this items ram power.
        Specified by:
        getRamPower in interface ItemRammable
        Returns:
        energy/2.
      • beRammed

        public boolean beRammed​(Figure rammer,
                                AnimationInfo animation)
        Called, if the item is rammed by a figure.
        Specified by:
        beRammed in interface ItemRammable
        Parameters:
        rammer - The rammer
        animation - the AnimationInfo.
        Returns:
        false because the figure can't enter the items point.
      • removeEnergy

        public void removeEnergy​(int min,
                                 Thing source,
                                 DieReason reason,
                                 AnimationInfo animation)
        Does nothing. Rock never loses energy.
        Overrides:
        removeEnergy in class Thing
        Parameters:
        min - The energy to remove.
        source - The source for the energy loss.
        reason - The reason for the energy loss.
        animation - The AnimationInfo.