Package games.stendhal.client.entity
Class Food
java.lang.Object
games.stendhal.client.entity.Entity
games.stendhal.client.entity.ActiveEntity
games.stendhal.client.entity.Food
- All Implemented Interfaces:
IEntity
,RPObjectChangeListener
- Direct Known Subclasses:
SheepFood
A food entity.
-
Field Summary
Modifier and TypeFieldDescriptionstatic games.stendhal.client.entity.Property
Amount property.Fields inherited from class games.stendhal.client.entity.ActiveEntity
PROP_DIRECTION, PROP_SPEED
Fields inherited from class games.stendhal.client.entity.Entity
clazz, inAdd, name, rpObject, title, type, x, y
Fields inherited from interface games.stendhal.client.entity.IEntity
PROP_ANIMATED, PROP_CLASS, PROP_NAME, PROP_POSITION, PROP_SIZE, PROP_STATE, PROP_TITLE, PROP_VISIBILITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
Get the amount.void
initialize(RPObject object)
Initialize this entity for an object.void
onChangedAdded(RPObject object, RPObject changes)
A slot object added/changed attribute(s).protected void
onPosition(double x, double y)
When the entity's position changed.protected void
playRandomSoundFromCategory(String groupName, String categoryName)
protected void
playRandomSoundFromGroup(String groupName, String categoryName, long waitTimeInMilliSec)
protected void
playSoundFromCategory(String groupName, String categoryName)
protected void
playSoundFromCategory(String groupName, String categoryName, int index)
Methods inherited from class games.stendhal.client.entity.ActiveEntity
getDirection, isFlying, processPositioning, stopped, update
Methods inherited from class games.stendhal.client.entity.Entity
addChangeListener, addContentChangeListener, fireChange, getArea, getCursor, getEntityClass, getEntitySubclass, getHeight, getID, getName, getObjectID, getPath, getResistance, getResistance, getRPObject, getSlot, getTitle, getType, getVisibility, getWidth, getX, getY, isObstacle, isOnGround, isUser, onAdded, onChangedRemoved, onRemoved, onSlotAdded, onSlotChangedAdded, onSlotChangedRemoved, onSlotRemoved, release, removeChangeListener, removeContentChangeListener, toString
-
Field Details
-
PROP_AMOUNT
public static final games.stendhal.client.entity.Property PROP_AMOUNTAmount property.
-
-
Constructor Details
-
Food
public Food()
-
-
Method Details
-
getAmount
public int getAmount()Get the amount.- Returns:
- The amount.
-
initialize
Initialize this entity for an object.- Specified by:
initialize
in interfaceIEntity
- Overrides:
initialize
in classActiveEntity
- Parameters:
object
- The object.- See Also:
Entity.release()
-
onChangedAdded
A slot object added/changed attribute(s).- Specified by:
onChangedAdded
in interfaceRPObjectChangeListener
- Overrides:
onChangedAdded
in classEntity
- Parameters:
object
- The base slot object.changes
- The slot changes.
-
addSounds
-
onPosition
protected void onPosition(double x, double y)Description copied from class:Entity
When the entity's position changed.- Overrides:
onPosition
in classEntity
- Parameters:
x
- The new X coordinate.y
- The new Y coordinate.
-
playRandomSoundFromCategory
-
playRandomSoundFromGroup
-
playSoundFromCategory
-
playSoundFromCategory
-