Class FlowerGrower

All Implemented Interfaces:
TurnListener, UseListener, Killer, Cloneable, Iterable<String>, Serializable

public class FlowerGrower extends VegetableGrower
Is an item producer that destroys itself when item is removed.

The standard vegetable grower would restart production cycle after removal of fruit. Fruit is only grown when FlowerGrower is in the same place as an entity in zone that implements FertileGround

  • Constructor Details

    • FlowerGrower

      public FlowerGrower(RPObject object, String itemname)
      Constructor for loading FlowerGrower from the stored zone used by StendhalRPObjectFactory.
      Parameters:
      object - the restored object from db
      itemname - the item to grow
      See Also:
      StendhalRPObjectFactory
    • FlowerGrower

      public FlowerGrower()
      Constructor. Default FlowerGrower produces lilia.
    • FlowerGrower

      public FlowerGrower(String infoString)
      Constructor of a FlowerGrower growing an item with the name specified in infostring.
      Parameters:
      infoString - the name of the item to produce
  • Method Details

    • onFruitPicked

      public void onFruitPicked(Item picked)
      Removes this from world. This method is called when the fruit of this grower is picked.
      Overrides:
      onFruitPicked in class GrowingPassiveEntityRespawnPoint
      Parameters:
      picked - The fruit that has been picked. Use null for subclasses of PlantGrower that don't use items as fruits.
    • getRandomTurnsForRegrow

      protected int getRandomTurnsForRegrow()
      Overrides:
      getRandomTurnsForRegrow in class PassiveEntityRespawnPoint
    • describe

      public String describe()
      The description depends upon the ripeness of the flower grower
      Overrides:
      describe in class VegetableGrower
      Returns:
      description from the players point of view
    • isOnFreeFertileGround

      public boolean isOnFreeFertileGround()
      Checks if this entity is on a free fertile spot. If yes, the flower can grow. Otherwise it withers and dies.
      Returns:
      true if there is an item implementing FertileGround in the zone, and the position of this is in its area.
    • growNewFruit

      protected void growNewFruit()
      Description copied from class: PassiveEntityRespawnPoint
      Creates a new fruit.
      Overrides:
      growNewFruit in class GrowingPassiveEntityRespawnPoint