Class CfItem
java.lang.Object
com.realtime.crossfire.jxclient.items.CfItem
- Direct Known Subclasses:
CfPlayer
The representation of a Crossfire Item, client-side.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe flags mask for applied states.static final intThe flags value for blessed items.static final intThe flags value for cursed items.static final intThe flags value for damned items.static final intThe flags value for locked items.static final intThe flags value for magical items.static final intThe flags value for non-pickable items.static final intThe flags value for opened items.static final intThe flags value for read items.static final intThe flags value for unidentified items.static final intThe flags value for unpaid items. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCfItemModifiedListener(@NotNull CfItemListener listener) Add aCfItemModifiedListener.intgetAnim()Returns the animation.intReturns the animation speed.@NotNull FacegetFace()Returns the face.intReturns the location.@NotNull StringgetName()Returns the name.intgetNrOf()Returns the number of objects in this item stack.intgetTag()Returns the tag.@NotNull StringReturns a description suitable for a tooltip text.@NotNull StringReturns the first line of the tooltip text.@NotNull StringReturns the second line of the tooltip text.@NotNull StringReturns the third line of the tooltip text.intgetType()Returns the type.intReturns the weight.booleanReturns whether this item is applied.booleanReturns whether this item is blessed.booleanisCursed()Returns whether this item is cursed.booleanisDamned()Returns whether this item is damned.booleanReturns whether this object is a fake object for selecting object groups in the ground view.booleanisLocked()Returns whether this item is locked.booleanisMagic()Returns whether this item is magical.booleanisMarked()Returns whether this item is marked.booleanisNoPick()Returns whether this item cannot be picked up.booleanisOpen()Returns whether this item is an opened container.booleanReturns whether this item is unidentified.booleanisUnpaid()Returns whether this item is unpaid.voidremoveCfItemModifiedListener(@NotNull CfItemListener listener) Remove aCfItemModifiedListener.voidsetLocation(int location) Updates the location.voidsetMarked(boolean marked) Sets whether this item is marked.voidupdate(int updateFlags, int flags, int weight, @NotNull Face face, @NotNull String name, @NotNull String namePl, int anim, int animSpeed, int nrof, boolean clearMarked) Processes an "upditem" command.
-
Field Details
-
F_APPLIED
public static final int F_APPLIEDThe flags mask for applied states.- See Also:
-
F_UNIDENTIFIED
public static final int F_UNIDENTIFIEDThe flags value for unidentified items.- See Also:
-
F_READ
public static final int F_READThe flags value for read items.- See Also:
-
F_BLESSED
public static final int F_BLESSEDThe flags value for blessed items.- See Also:
-
F_UNPAID
public static final int F_UNPAIDThe flags value for unpaid items.- See Also:
-
F_MAGIC
public static final int F_MAGICThe flags value for magical items.- See Also:
-
F_CURSED
public static final int F_CURSEDThe flags value for cursed items.- See Also:
-
F_DAMNED
public static final int F_DAMNEDThe flags value for damned items.- See Also:
-
F_OPEN
public static final int F_OPENThe flags value for opened items.- See Also:
-
F_NOPICK
public static final int F_NOPICKThe flags value for non-pickable items.- See Also:
-
F_LOCKED
public static final int F_LOCKEDThe flags value for locked items.- See Also:
-
-
Constructor Details
-
CfItem
public CfItem(int location, int tag, int flags, int weight, @NotNull @NotNull Face face, @NotNull @NotNull String name, @NotNull @NotNull String namePl, int anim, int animSpeed, int nrof, int type) Creates a new instance.- Parameters:
location- the locationtag- the tagflags- the flagsweight- the weightface- the facename- the singular namenamePl- the plural nameanim- the animationanimSpeed- the animation speednrof- the number of objects in the stacktype- the type
-
-
Method Details
-
setLocation
public void setLocation(int location) Updates the location.- Parameters:
location- the new location
-
getTag
public int getTag()Returns the tag.- Returns:
- the tag
-
getWeight
public int getWeight()Returns the weight.- Returns:
- the weight
-
getFace
Returns the face.- Returns:
- the face
-
getName
Returns the name.- Returns:
- the name
-
getAnim
public int getAnim()Returns the animation.- Returns:
- the animation
-
getAnimSpeed
public int getAnimSpeed()Returns the animation speed.- Returns:
- the animation speed
-
getNrOf
public int getNrOf()Returns the number of objects in this item stack.- Returns:
- whether the number of objects
-
isApplied
public boolean isApplied()Returns whether this item is applied.- Returns:
- whether this item is applied
-
isUnidentified
public boolean isUnidentified()Returns whether this item is unidentified.- Returns:
- whether this item is unidentified
-
isBlessed
public boolean isBlessed()Returns whether this item is blessed.- Returns:
- whether this item is blessed
-
isUnpaid
public boolean isUnpaid()Returns whether this item is unpaid.- Returns:
- whether this item is unpaid
-
isMagic
public boolean isMagic()Returns whether this item is magical.- Returns:
- whether this item is magical
-
isCursed
public boolean isCursed()Returns whether this item is cursed.- Returns:
- whether this item is cursed
-
isDamned
public boolean isDamned()Returns whether this item is damned.- Returns:
- whether this item is damned
-
isOpen
public boolean isOpen()Returns whether this item is an opened container.- Returns:
- whether this item is an opened container
-
isNoPick
public boolean isNoPick()Returns whether this item cannot be picked up.- Returns:
- whether this item cannot be picked up
-
isLocked
public boolean isLocked()Returns whether this item is locked.- Returns:
- whether this item is locked
-
isMarked
public boolean isMarked()Returns whether this item is marked.- Returns:
- whether this item is marked
-
setMarked
public void setMarked(boolean marked) Sets whether this item is marked.- Parameters:
marked- whether this item is marked
-
getLocation
public int getLocation()Returns the location.- Returns:
- the location
-
getType
public int getType()Returns the type.- Returns:
- the type
-
update
public void update(int updateFlags, int flags, int weight, @NotNull @NotNull Face face, @NotNull @NotNull String name, @NotNull @NotNull String namePl, int anim, int animSpeed, int nrof, boolean clearMarked) Processes an "upditem" command.- Parameters:
updateFlags- the changed valuesflags- the new flagsweight- the new weightface- the new facename- the new singular namenamePl- the new plural nameanim- the new animation IDanimSpeed- the new animation speednrof- the new number of itemsclearMarked- whether the "marked" flag should be cleared
-
addCfItemModifiedListener
Add aCfItemModifiedListener. The listener will be notified about attribute changes of this item.- Parameters:
listener- the listener to remove
-
removeCfItemModifiedListener
Remove aCfItemModifiedListener.- Parameters:
listener- the listener to remove
-
getTooltipText
Returns a description suitable for a tooltip text.- Returns:
- the tooltip text
-
getTooltipText1
Returns the first line of the tooltip text.- Returns:
- the tooltip text
-
getTooltipText2
Returns the second line of the tooltip text.- Returns:
- the tooltip text
-
getTooltipText3
Returns the third line of the tooltip text.- Returns:
- the tooltip text
-
isItemGroupButton
public boolean isItemGroupButton()Returns whether this object is a fake object for selecting object groups in the ground view.- Returns:
- whether this object is a group button
-