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
Modifier and TypeFieldDescriptionstatic games.stendhal.client.entity.Property
Animated property.static games.stendhal.client.entity.Property
Entity class/subclass property.static games.stendhal.client.entity.Property
Name property.static games.stendhal.client.entity.Property
Position property.static games.stendhal.client.entity.Property
Size property.static games.stendhal.client.entity.Property
State propertystatic games.stendhal.client.entity.Property
Title property.static games.stendhal.client.entity.Property
Visibility property. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener(EntityChangeListener<?> listener)
Add a change listener.void
addContentChangeListener(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.double
Get the entity height.getID()
getName()
Get the name.getPath()
Get identifier path for the entity.int
Get the resistance this has on other entities (0-100).int
getResistance(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.int
Get the entity visibility.double
getWidth()
Get the entity width.double
getX()
Get the X coordinate.double
getY()
Get the Y coordinate.void
initialize(RPObject object)
Initialize this entity for an object.boolean
isObstacle(IEntity entity)
Determine if this is an obstacle for another entity.boolean
Determine if this entity is on the ground.boolean
isUser()
Check if the entity is the user.void
release()
Release this entity.void
removeChangeListener(EntityChangeListener<?> listener)
Remove a change listener.void
removeContentChangeListener(ContentChangeListener listener)
Remove a content change listener.void
update(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
null
if 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:
true
if the entity is on the ground.
-
isUser
boolean isUser()Check if the entity is the user.- Returns:
true
if 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
null
if 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:
true
the 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
-
-