Class PassiveEntityRespawnPoint

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

public class PassiveEntityRespawnPoint extends Entity implements TurnListener
A PassiveEntityRespawnPoint basically is a 1x1 area where a plant, a fruit or another non-moving thing grows. This growing thing is a pickable Item (e.g. a mushroom, an apple); by extending this class, it can also grow something special (e.g. SheepFood). PassiveEntityRespawnPoint are currently invisible (fully transparent) on the client side. Extend GrowingPassiveEntityRespawnPoint and implement UseListener if grown item should not be dragable without special interaction.
Author:
Daniel Herding
  • Field Details

    • meanTurnsForRegrow

      protected int meanTurnsForRegrow
      Tells how many turns it takes in average for a new fruit to become ripe.
  • Constructor Details

    • PassiveEntityRespawnPoint

      public PassiveEntityRespawnPoint(RPObject object, String growingItemName, int meanTurnsForRegrow)
    • PassiveEntityRespawnPoint

      public PassiveEntityRespawnPoint(String growingItemName, int meanTurnsForRegrow)
  • Method Details

    • generateRPClass

      public static void generateRPClass()
    • onFruitPicked

      public void onFruitPicked(Item picked)
      Is called when a fruit has been picked from this plant grower.
      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()
    • growNewFruit

      protected void growNewFruit()
      Creates a new fruit.
    • setToFullGrowth

      public void setToFullGrowth()
    • onTurnReached

      public void onTurnReached(int currentTurn)
      Description copied from interface: TurnListener
      This method is called when the turn number is reached.
      Specified by:
      onTurnReached in interface TurnListener
      Parameters:
      currentTurn - current turn number
    • setStartState

      public void setStartState()
    • onItemPickedUp

      public void onItemPickedUp(Player player)