Class VegetableGrower

All Implemented Interfaces:
TurnListener, UseListener, Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
FlowerGrower

public class VegetableGrower extends GrowingPassiveEntityRespawnPoint implements UseListener
A growing carrot which can be picked.
Author:
hendrik
  • Constructor Details

    • VegetableGrower

      public VegetableGrower(RPObject object, String name, int maxRipeness, int growthRate)
      Create a VegetableGrower from an RPObject. Used when restoring growers from the DB.
      Parameters:
      object - object to be converted
      name - item name
      maxRipeness - maximum ripeness of the object
      growthRate - average time between growth steps
    • VegetableGrower

      public VegetableGrower(String name)
      Create a new VegetableGrower for an item.
      Parameters:
      name - item name
    • VegetableGrower

      public VegetableGrower(String name, String notRipeEnoughMessage)
      Create a new VegetableGrower for an item.
      Parameters:
      name - item name
      notRipeEnoughMessage - The message displayed when the player tries to pick the item but it is not yet ripe enough.
  • Method Details

    • setVegetableName

      protected final void setVegetableName(String vegetableName)
    • getVegetableName

      protected String getVegetableName()
    • setNotRipeEnoughMessage

      protected final void setNotRipeEnoughMessage(String notRipeEnoughMessage)
    • getNotRipeEnoughMessage

      protected String getNotRipeEnoughMessage()
    • describe

      public String describe()
      Description copied from class: Entity
      Describes the entity (if a players looks at it).
      Overrides:
      describe in class Entity
      Returns:
      description from the players point of view
    • onUsed

      public boolean onUsed(RPEntity entity)
      Is called when a player tries to harvest this item.
      Specified by:
      onUsed in interface UseListener
      Parameters:
      entity - that tries to harvest
      Returns:
      true on success