Package games.stendhal.client.entity
Interface IEntity
- All Known Implementing Classes:
ActiveEntity,Block,Blood,BossCreature,Box,BreakableRing,CarrotGrower,Chest,Corpse,Creature,DomesticAnimal,Door,Entity,Fire,FlyOverArea,Food,GameBoard,Gate,GrainField,HousePortal,InvisibleEntity,Item,LoopedSoundSource,NPC,Pet,PlantGrower,Player,Portal,Ring,RPEntity,Sheep,SheepFood,Sign,Spell,StackableItem,StatefulEntity,UseableItem,UseableRing,User,WalkBlocker,Wall
public interface IEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic games.stendhal.client.entity.PropertyAnimated property.static games.stendhal.client.entity.PropertyEntity class/subclass property.static games.stendhal.client.entity.PropertyName property.static games.stendhal.client.entity.PropertyPosition property.static games.stendhal.client.entity.PropertySize property.static games.stendhal.client.entity.PropertyState propertystatic games.stendhal.client.entity.PropertyTitle property.static games.stendhal.client.entity.PropertyVisibility property. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(EntityChangeListener<?> listener)Add a change listener.voidaddContentChangeListener(ContentChangeListener listener)Add a listener for content changesgetArea()Get the area the entity occupies.gets the cursor nameGet the entity class.Get the entity sub-class.doubleGet the entity height.getID()getName()Get the name.getPath()Get identifier path for the entity.intGet the resistance this has on other entities (0-100).intgetResistance(IEntity entity)Get the amount of resistance between this and another entity (0-100).Get the RPObject this represents.Gets the slot specified by name.getTitle()Get the nicely formatted entity title.getType()Get the entity type.intGet the entity visibility.doublegetWidth()Get the entity width.doublegetX()Get the X coordinate.doublegetY()Get the Y coordinate.voidinitialize(RPObject object)Initialize this entity for an object.booleanisObstacle(IEntity entity)Determine if this is an obstacle for another entity.booleanDetermine if this entity is on the ground.booleanisUser()Check if the entity is the user.voidrelease()Release this entity.voidremoveChangeListener(EntityChangeListener<?> listener)Remove a change listener.voidremoveContentChangeListener(ContentChangeListener listener)Remove a content change listener.voidupdate(int delta)Update cycle.
-
Field Details
-
PROP_ANIMATED
static final games.stendhal.client.entity.Property PROP_ANIMATEDAnimated property. -
PROP_CLASS
static final games.stendhal.client.entity.Property PROP_CLASSEntity class/subclass property. -
PROP_NAME
static final games.stendhal.client.entity.Property PROP_NAMEName property. -
PROP_POSITION
static final games.stendhal.client.entity.Property PROP_POSITIONPosition property. -
PROP_SIZE
static final games.stendhal.client.entity.Property PROP_SIZESize property. -
PROP_TITLE
static final games.stendhal.client.entity.Property PROP_TITLETitle property. -
PROP_VISIBILITY
static final games.stendhal.client.entity.Property PROP_VISIBILITYVisibility property. -
PROP_STATE
static final games.stendhal.client.entity.Property PROP_STATEState property
-
-
Method Details
-
addChangeListener
Add a change listener.- Parameters:
listener- The listener.
-
getArea
Rectangle2D getArea()Get the area the entity occupies.- Returns:
- A rectange (in world coordinate units).
-
getVisibility
int getVisibility()Get the entity visibility.- Returns:
- The entity visibility (0 - 100).
-
getHeight
double getHeight()Get the entity height.- Returns:
- The height.
-
getID
RPObject.ID getID()- Returns:
- the represented arianne object id.
-
getEntityClass
String getEntityClass()Get the entity class.- Returns:
- The entity class.
-
getName
String getName()Get the name.- Returns:
- The name.
-
getEntitySubclass
String getEntitySubclass()Get the entity sub-class.- Returns:
- The entity sub-class.
-
getTitle
String getTitle()Get the nicely formatted entity title. This searches the follow attribute order: title, name (w/o underscore), type (w/o underscore).- Returns:
- The title, or
nullif unknown.
-
getType
String getType()Get the entity type.- Returns:
- The type.
-
getX
double getX()Get the X coordinate.- Returns:
- The X coordinate.
-
getY
double getY()Get the Y coordinate.- Returns:
- The Y coordinate.
-
getRPObject
RPObject getRPObject()Get the RPObject this represents.- Returns:
- The RPObject.
-
getWidth
double getWidth()Get the entity width.- Returns:
- The width.
-
isOnGround
boolean isOnGround()Determine if this entity is on the ground.- Returns:
trueif the entity is on the ground.
-
isUser
boolean isUser()Check if the entity is the user.- Returns:
trueif the entity is the user
-
getResistance
int getResistance()Get the resistance this has on other entities (0-100).- Returns:
- The resistance.
-
getResistance
Get the amount of resistance between this and another entity (0-100).- Parameters:
entity- The entity to check against.- Returns:
- The effective resistance.
-
getSlot
Gets the slot specified by name.- Parameters:
name- of the slot- Returns:
- the specified slot or
nullif the entity does not have this slot
-
initialize
Initialize this entity for an object.- Parameters:
object- The object.- See Also:
release()
-
isObstacle
Determine if this is an obstacle for another entity.- Parameters:
entity- The entity to check against.- Returns:
truethe entity can not enter this entity's area.
-
release
void release()Release this entity. This should clean anything that isn't automatically released (such as unregister callbacks, cancel external operations, etc).- See Also:
initialize(RPObject)
-
removeChangeListener
Remove a change listener.- Parameters:
listener- The listener.
-
update
void update(int delta)Update cycle.- Parameters:
delta- The time (in ms) since last call.
-
getCursor
String getCursor()gets the cursor name- Returns:
- name of cursor
-
getPath
Get identifier path for the entity.- Returns:
- List of object identifiers and slot names that make up the complete path to the entity
-
addContentChangeListener
Add a listener for content changes- Parameters:
listener-
-
removeContentChangeListener
Remove a content change listener.- Parameters:
listener-
-