java.lang.Object
com.realtime.crossfire.jxclient.items.CfItem
Direct Known Subclasses:
CfPlayer

public class CfItem extends Object
The representation of a Crossfire Item, client-side.
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The flags mask for applied states.
    static final int
    The flags value for blessed items.
    static final int
    The flags value for cursed items.
    static final int
    The flags value for damned items.
    static final int
    The flags value for locked items.
    static final int
    The flags value for magical items.
    static final int
    The flags value for non-pickable items.
    static final int
    The flags value for opened items.
    static final int
    The flags value for read items.
    static final int
    The flags value for unidentified items.
    static final int
    The flags value for unpaid items.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CfItem(int location, int tag, int flags, int weight, @NotNull Face face, @NotNull String name, @NotNull String namePl, int anim, int animSpeed, int nrof, int type)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a CfItemModifiedListener.
    int
    Returns the animation.
    int
    Returns the animation speed.
    @NotNull Face
    Returns the face.
    int
    Returns the location.
    @NotNull String
    Returns the name.
    int
    Returns the number of objects in this item stack.
    int
    Returns the tag.
    @NotNull String
    Returns a description suitable for a tooltip text.
    @NotNull String
    Returns the first line of the tooltip text.
    @NotNull String
    Returns the second line of the tooltip text.
    @NotNull String
    Returns the third line of the tooltip text.
    int
    Returns the type.
    int
    Returns the weight.
    boolean
    Returns whether this item is applied.
    boolean
    Returns whether this item is blessed.
    boolean
    Returns whether this item is cursed.
    boolean
    Returns whether this item is damned.
    boolean
    Returns whether this object is a fake object for selecting object groups in the ground view.
    boolean
    Returns whether this item is locked.
    boolean
    Returns whether this item is magical.
    boolean
    Returns whether this item is marked.
    boolean
    Returns whether this item cannot be picked up.
    boolean
    Returns whether this item is an opened container.
    boolean
    Returns whether this item is unidentified.
    boolean
    Returns whether this item is unpaid.
    void
    Remove a CfItemModifiedListener.
    void
    setLocation(int location)
    Updates the location.
    void
    setMarked(boolean marked)
    Sets whether this item is marked.
    void
    update(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • F_APPLIED

      public static final int F_APPLIED
      The flags mask for applied states.
      See Also:
    • F_UNIDENTIFIED

      public static final int F_UNIDENTIFIED
      The flags value for unidentified items.
      See Also:
    • F_READ

      public static final int F_READ
      The flags value for read items.
      See Also:
    • F_BLESSED

      public static final int F_BLESSED
      The flags value for blessed items.
      See Also:
    • F_UNPAID

      public static final int F_UNPAID
      The flags value for unpaid items.
      See Also:
    • F_MAGIC

      public static final int F_MAGIC
      The flags value for magical items.
      See Also:
    • F_CURSED

      public static final int F_CURSED
      The flags value for cursed items.
      See Also:
    • F_DAMNED

      public static final int F_DAMNED
      The flags value for damned items.
      See Also:
    • F_OPEN

      public static final int F_OPEN
      The flags value for opened items.
      See Also:
    • F_NOPICK

      public static final int F_NOPICK
      The flags value for non-pickable items.
      See Also:
    • F_LOCKED

      public static final int F_LOCKED
      The 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 location
      tag - the tag
      flags - the flags
      weight - the weight
      face - the face
      name - the singular name
      namePl - the plural name
      anim - the animation
      animSpeed - the animation speed
      nrof - the number of objects in the stack
      type - 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

      @NotNull public @NotNull Face getFace()
      Returns the face.
      Returns:
      the face
    • getName

      @NotNull public @NotNull 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
    • 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 values
      flags - the new flags
      weight - the new weight
      face - the new face
      name - the new singular name
      namePl - the new plural name
      anim - the new animation ID
      animSpeed - the new animation speed
      nrof - the new number of items
      clearMarked - whether the "marked" flag should be cleared
    • addCfItemModifiedListener

      public void addCfItemModifiedListener(@NotNull @NotNull CfItemListener listener)
      Add a CfItemModifiedListener. 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 a CfItemModifiedListener.
      Parameters:
      listener - the listener to remove
    • getTooltipText

      @NotNull public @NotNull String getTooltipText()
      Returns a description suitable for a tooltip text.
      Returns:
      the tooltip text
    • getTooltipText1

      @NotNull public @NotNull String getTooltipText1()
      Returns the first line of the tooltip text.
      Returns:
      the tooltip text
    • getTooltipText2

      @NotNull public @NotNull String getTooltipText2()
      Returns the second line of the tooltip text.
      Returns:
      the tooltip text
    • getTooltipText3

      @NotNull public @NotNull 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