Class DomesticAnimal

All Implemented Interfaces:
IEntity, RPObjectChangeListener
Direct Known Subclasses:
Pet, Sheep

public abstract class DomesticAnimal extends NPC
A domestic animal entity.
  • Field Details

    • PROP_WEIGHT

      public static final games.stendhal.client.entity.Property PROP_WEIGHT
      DomesticAnimal weight property.
  • Constructor Details

    • DomesticAnimal

      public DomesticAnimal()
  • Method Details

    • getWeight

      public int getWeight()
      Get the weight.
      Returns:
      The animal's weight.
    • initialize

      public void initialize(RPObject object)
      Initialize this entity for an object.
      Specified by:
      initialize in interface IEntity
      Overrides:
      initialize in class NPC
      Parameters:
      object - The object.
      See Also:
      RPEntity.release()
    • onChangedAdded

      public void onChangedAdded(RPObject object, RPObject changes)
      The object added/changed attribute(s).
      Specified by:
      onChangedAdded in interface RPObjectChangeListener
      Overrides:
      onChangedAdded in class NPC
      Parameters:
      object - The base object.
      changes - The changes.
    • addSounds

      protected void addSounds(String groupName, String categoryName, String... soundNames)
    • onPosition

      protected void onPosition(double x, double y)
      Description copied from class: Entity
      When the entity's position changed.
      Overrides:
      onPosition in class Entity
      Parameters:
      x - The new X coordinate.
      y - The new Y coordinate.
    • playRandomSoundFromCategory

      protected void playRandomSoundFromCategory(String groupName, String categoryName)
    • playRandomSoundFromGroup

      protected void playRandomSoundFromGroup(String groupName, String categoryName, long waitTimeInMilliSec)
    • playSoundFromCategory

      protected void playSoundFromCategory(String groupName, String categoryName)
    • playSoundFromCategory

      protected void playSoundFromCategory(String groupName, String categoryName, int index)