All Implemented Interfaces:
Pickable

public class Life extends MapItem implements Pickable
Represents a life in the labyrinth/map.
  • Field Details

    • picked

      private boolean picked
      This attribute allows us to manage if the life has been picked or not. Its initial/default value is false.
  • Constructor Details

    • Life

      public Life(Position position)
      Constructor with argument.
      The value for pathable is true and for sprite is Sprite.LIFE.
      Parameters:
      position - The position where the life is.
  • Method Details

    • isPicked

      public boolean isPicked()
      Getter of the attribute picked.
      Specified by:
      isPicked in interface Pickable
      Returns:
      The current value of the attribute picked.
      Since:
      isPicked in interface Pickable.
    • setPicked

      public void setPicked(boolean picked)
      Setter of the attribute pickled.
      Specified by:
      setPicked in interface Pickable
      Parameters:
      picked - New value for the attribute picked.
      Since:
      setPicked in interface Pickable.