Class CfItem
- java.lang.Object
-
- com.realtime.crossfire.jxclient.items.CfItem
-
- Direct Known Subclasses:
CfPlayer
public class CfItem extends java.lang.ObjectThe representation of a Crossfire Item, client-side.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static intF_APPLIEDThe flags mask for applied states.static intF_BLESSEDThe flags value for blessed items.static intF_CURSEDThe flags value for cursed items.static intF_DAMNEDThe flags value for damned items.static intF_LOCKEDThe flags value for locked items.static intF_MAGICThe flags value for magical items.static intF_NOPICKThe flags value for non-pickable items.static intF_OPENThe flags value for opened items.static intF_UNIDENTIFIEDThe flags value for unidentified items.static intF_UNPAIDThe flags value for unpaid items.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCfItemModifiedListener(@NotNull CfItemListener listener)Add aCfItemModifiedListener.intgetAnim()Returns the animation.intgetAnimSpeed()Returns the animation speed.@NotNull FacegetFace()Returns the face.intgetLocation()Returns the location.@NotNull java.lang.StringgetName()Returns the name.intgetNrOf()Returns the number of objects in this item stack.intgetTag()Returns the tag.@NotNull java.lang.StringgetTooltipText()Returns a description suitable for a tooltip text.@NotNull java.lang.StringgetTooltipText1()Returns the first line of the tooltip text.@NotNull java.lang.StringgetTooltipText2()Returns the second line of the tooltip text.@NotNull java.lang.StringgetTooltipText3()Returns the third line of the tooltip text.intgetType()Returns the type.intgetWeight()Returns the weight.booleanisApplied()Returns whether this item is applied.booleanisBlessed()Returns whether this item is blessed.booleanisCursed()Returns whether this item is cursed.booleanisDamned()Returns whether this item is damned.booleanisItemGroupButton()Returns 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.booleanisNoPick()Returns whether this item cannot be picked up.booleanisOpen()Returns whether this item is an opened container.booleanisUnidentified()Returns whether this item is unidentified.booleanisUnpaid()Returns whether this item is unpaid.voidremoveCfItemModifiedListener(@NotNull CfItemListener listener)Remove aCfItemModifiedListener.voidsetLocation(int location)Updates the location.voidupdate(int updateFlags, int flags, int weight, @NotNull Face face, @NotNull java.lang.String name, @NotNull java.lang.String namePl, int anim, int animSpeed, int nrof)Processes an "upditem" command.
-
-
-
Field Detail
-
F_APPLIED
public static final int F_APPLIED
The flags mask for applied states.- See Also:
- Constant Field Values
-
F_UNIDENTIFIED
public static final int F_UNIDENTIFIED
The flags value for unidentified items.- See Also:
- Constant Field Values
-
F_BLESSED
public static final int F_BLESSED
The flags value for blessed items.- See Also:
- Constant Field Values
-
F_UNPAID
public static final int F_UNPAID
The flags value for unpaid items.- See Also:
- Constant Field Values
-
F_MAGIC
public static final int F_MAGIC
The flags value for magical items.- See Also:
- Constant Field Values
-
F_CURSED
public static final int F_CURSED
The flags value for cursed items.- See Also:
- Constant Field Values
-
F_DAMNED
public static final int F_DAMNED
The flags value for damned items.- See Also:
- Constant Field Values
-
F_OPEN
public static final int F_OPEN
The flags value for opened items.- See Also:
- Constant Field Values
-
F_NOPICK
public static final int F_NOPICK
The flags value for non-pickable items.- See Also:
- Constant Field Values
-
F_LOCKED
public static final int F_LOCKED
The flags value for locked items.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CfItem
public CfItem(int location, int tag, int flags, int weight, @NotNull @NotNull Face face, @NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.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 Detail
-
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
@NotNull public @NotNull Face getFace()
Returns the face.- Returns:
- the face
-
getName
@NotNull public @NotNull java.lang.String 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
-
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 java.lang.String name, @NotNull @NotNull java.lang.String namePl, int anim, int animSpeed, int nrof)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 items
-
addCfItemModifiedListener
public void addCfItemModifiedListener(@NotNull @NotNull CfItemListener listener)Add aCfItemModifiedListener. The listener will be notified about attribute changes of this item.- Parameters:
listener- the listener to remove
-
removeCfItemModifiedListener
public void removeCfItemModifiedListener(@NotNull @NotNull CfItemListener listener)Remove aCfItemModifiedListener.- Parameters:
listener- the listener to remove
-
getTooltipText
@NotNull public @NotNull java.lang.String getTooltipText()
Returns a description suitable for a tooltip text.- Returns:
- the tooltip text
-
getTooltipText1
@NotNull public @NotNull java.lang.String getTooltipText1()
Returns the first line of the tooltip text.- Returns:
- the tooltip text
-
getTooltipText2
@NotNull public @NotNull java.lang.String getTooltipText2()
Returns the second line of the tooltip text.- Returns:
- the tooltip text
-
getTooltipText3
@NotNull public @NotNull java.lang.String 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
-
-