Class GrowingPassiveEntityRespawnPoint

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

public abstract class GrowingPassiveEntityRespawnPoint extends PassiveEntityRespawnPoint
This respwan point has to be "used" to get the item. After that, it will slowly regrow; there are several regrowing steps in which the graphics will change to show the progress.
Author:
daniel, hendrik
  • Constructor Details

    • GrowingPassiveEntityRespawnPoint

      public GrowingPassiveEntityRespawnPoint(RPObject object, String type, String itemName, String actionName, int maxRipeness, int growthRate)
      Create a GrowingPassiveEntityRespawnPoint from an RPObject. Used for restoring growers stored in the zone.
      Parameters:
      object - The RPObject to be converted
      type - Entity class
      itemName - Name of the spawned item
      actionName - Name of the use action
      maxRipeness - Maximum ripeness stage of the grower
      growthRate - Average time between growth steps in turns
    • GrowingPassiveEntityRespawnPoint

      public GrowingPassiveEntityRespawnPoint(String type, String itemName, String actionName, int maxRipeness, int width, int height)
      Create a new GrowingPassiveEntityRespawnPoint.
      Parameters:
      type - Entity class
      itemName - Name of the grown entity
      actionName - Name of the use action
      maxRipeness - Maximum ripeness stage of the grower
      width - Width of the grower entity
      height - Height of the grower entity
  • Method Details

    • getMaxRipeness

      protected final int getMaxRipeness()
      Get the maximum ripeness.
      Returns:
      the stage at which the grown item is ready for harvesting
    • generateRPClass

      public static void generateRPClass()
      Register RPClass for GrowingPassiveEntityRespawnPoints. The used identifier is "growing_entity_spawner".
    • update

      public void update()
      Overrides:
      update in class Entity
    • setRipeness

      protected void setRipeness(int ripeness)
      Set the current ripeness stage of the grower.
      Parameters:
      ripeness -
    • getRipeness

      protected int getRipeness()
      Get the current ripeness stage of the grower.
      Returns:
      ripeness
    • growNewFruit

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

      public void onFruitPicked(Item picked)
      Description copied from class: PassiveEntityRespawnPoint
      Is called when a fruit has been picked from this plant grower.
      Overrides:
      onFruitPicked in class PassiveEntityRespawnPoint
      Parameters:
      picked - The fruit that has been picked. Use null for subclasses of PlantGrower that don't use items as fruits.
    • onItemPickedUp

      public void onItemPickedUp(Player player)
      Overrides:
      onItemPickedUp in class PassiveEntityRespawnPoint
    • setToFullGrowth

      public void setToFullGrowth()
      Overrides:
      setToFullGrowth in class PassiveEntityRespawnPoint