Crossfire JXClient, Trunk
com.realtime.crossfire.jxclient.items.CfItem Class Reference

The representation of a Crossfire Item, client-side. More...

+ Inheritance diagram for com.realtime.crossfire.jxclient.items.CfItem:
+ Collaboration diagram for com.realtime.crossfire.jxclient.items.CfItem:

Public Member Functions

void addCfItemModifiedListener (@NotNull final CfItemListener listener)
 Add a. More...
 
 CfItem (final int location, final int tag, final int flags, final int weight, @NotNull final Face face, @NotNull final String name, @NotNull final String namePl, final int anim, final int animSpeed, final int nrof, final int type)
 Creates a new instance. More...
 
int getAnim ()
 Returns the animation. More...
 
int getAnimSpeed ()
 Returns the animation speed. More...
 
Face getFace ()
 Returns the face. More...
 
int getLocation ()
 Returns the location. More...
 
String getName ()
 Returns the name. More...
 
int getNrOf ()
 Returns the number of objects in this item stack. More...
 
int getTag ()
 Returns the tag. More...
 
String getTooltipText ()
 Returns a description suitable for a tooltip text. More...
 
String getTooltipText1 ()
 Returns the first line of the tooltip text. More...
 
String getTooltipText2 ()
 Returns the second line of the tooltip text. More...
 
String getTooltipText3 ()
 Returns the third line of the tooltip text. More...
 
int getType ()
 Returns the type. More...
 
int getWeight ()
 Returns the weight. More...
 
boolean isApplied ()
 Returns whether this item is applied. More...
 
boolean isBlessed ()
 Returns whether this item is blessed. More...
 
boolean isCursed ()
 Returns whether this item is cursed. More...
 
boolean isDamned ()
 Returns whether this item is damned. More...
 
boolean isItemGroupButton ()
 Returns whether this object is a fake object for selecting object groups in the ground view. More...
 
boolean isLocked ()
 Returns whether this item is locked. More...
 
boolean isMagic ()
 Returns whether this item is magical. More...
 
boolean isMarked ()
 Returns whether this item is marked. More...
 
boolean isNoPick ()
 Returns whether this item cannot be picked up. More...
 
boolean isOpen ()
 Returns whether this item is an opened container. More...
 
boolean isUnidentified ()
 Returns whether this item is unidentified. More...
 
boolean isUnpaid ()
 Returns whether this item is unpaid. More...
 
void removeCfItemModifiedListener (@NotNull final CfItemListener listener)
 Remove a. More...
 
void setLocation (final int location)
 Updates the location. More...
 
void setMarked (final boolean marked)
 Sets whether this item is marked. More...
 
void update (final int updateFlags, final int flags, final int weight, @NotNull final Face face, @NotNull final String name, @NotNull final String namePl, final int anim, final int animSpeed, final int nrof, final boolean clearMarked)
 Processes an "upditem" command. More...
 

Static Public Attributes

static final int F_APPLIED = 0x000F
 The flags mask for applied states. More...
 
static final int F_BLESSED = 0x0100
 The flags value for blessed items. More...
 
static final int F_CURSED = 0x0800
 The flags value for cursed items. More...
 
static final int F_DAMNED = 0x1000
 The flags value for damned items. More...
 
static final int F_LOCKED = 0x8000
 The flags value for locked items. More...
 
static final int F_MAGIC = 0x0400
 The flags value for magical items. More...
 
static final int F_NOPICK = 0x4000
 The flags value for non-pickable items. More...
 
static final int F_OPEN = 0x2000
 The flags value for opened items. More...
 
static final int F_READ = 0x0020
 The flags value for read items. More...
 
static final int F_UNIDENTIFIED = 0x0010
 The flags value for unidentified items. More...
 
static final int F_UNPAID = 0x0200
 The flags value for unpaid items. More...
 

Private Member Functions

void appendFlag (@NotNull final StringBuilder sb, final int flag, @NotNull final String ident)
 Appends "(<ident>)" if this item has the flag. More...
 
void fireModified ()
 Notify all listener. More...
 
void setAnim (final int anim)
 Updates the animation. More...
 
void setAnimSpeed (final int animSpeed)
 Updates the animation speed. More...
 
void setFace (@NotNull final Face face)
 Updates the face. More...
 
void setFlags (final int flags)
 Updates the flags. More...
 
void setName (@NotNull final String name, @NotNull final String namePl)
 Updates the name. More...
 
void setNrOf (final int nrof)
 Updates the number of objects in the stack. More...
 
void setWeight (final int weight)
 Updates the weight. More...
 

Private Attributes

int anim
 The animation. More...
 
int animSpeed
 The animation speed. More...
 
Face face
 The face. More...
 
int flags
 The flags. More...
 
final EventListenerList2< CfItemListenerlisteners = new EventListenerList2<>()
 The listeners to be notified. More...
 
int location
 The location. More...
 
boolean marked
 Whether this item is marked by the player. More...
 
boolean modified = true
 Set if any attribute has changed since the last time listeners were notified. More...
 
String name
 The singular name. More...
 
String namePl
 The plural name. More...
 
int nrof
 The number of objects in the stack. More...
 
final int tag
 The tag. More...
 
final int type
 The type. More...
 
int weight
 The weight. More...
 

Detailed Description

The representation of a Crossfire Item, client-side.

Author
Lauwenmark
Andreas Kirschbaum
Version
1.0
Since
1.0

Definition at line 37 of file CfItem.java.

Constructor & Destructor Documentation

◆ CfItem()

com.realtime.crossfire.jxclient.items.CfItem.CfItem ( final int  location,
final int  tag,
final int  flags,
final int  weight,
@NotNull final Face  face,
@NotNull final String  name,
@NotNull final String  namePl,
final int  anim,
final int  animSpeed,
final int  nrof,
final int  type 
)

Member Function Documentation

◆ addCfItemModifiedListener()

void com.realtime.crossfire.jxclient.items.CfItem.addCfItemModifiedListener ( @NotNull final CfItemListener  listener)

Add a.

CfItemModifiedListener

. The listener will be notified about attribute changes of this item.

Parameters
listenerthe listener to remove

Definition at line 517 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.listeners.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemItem.setItem().

+ Here is the caller graph for this function:

◆ appendFlag()

void com.realtime.crossfire.jxclient.items.CfItem.appendFlag ( @NotNull final StringBuilder  sb,
final int  flag,
@NotNull final String  ident 
)
private

Appends "(&lt;ident&gt;)" if this item has the flag.

flag

set.

Parameters
sbthe string builder to append to
flagthe flag to check
identthe ident string to append

Definition at line 606 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.flags.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3().

+ Here is the caller graph for this function:

◆ fireModified()

void com.realtime.crossfire.jxclient.items.CfItem.fireModified ( )
private

◆ getAnim()

int com.realtime.crossfire.jxclient.items.CfItem.getAnim ( )

Returns the animation.

Returns
the animation

Definition at line 321 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.anim.

◆ getAnimSpeed()

int com.realtime.crossfire.jxclient.items.CfItem.getAnimSpeed ( )

Returns the animation speed.

Returns
the animation speed

Definition at line 329 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.animSpeed.

◆ getFace()

◆ getLocation()

int com.realtime.crossfire.jxclient.items.CfItem.getLocation ( )

Returns the location.

Returns
the location

Definition at line 445 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.location.

Referenced by com.realtime.crossfire.jxclient.items.ItemSet.removeItemByTag(), and com.realtime.crossfire.jxclient.items.ItemSet.updateItem().

+ Here is the caller graph for this function:

◆ getName()

String com.realtime.crossfire.jxclient.items.CfItem.getName ( )

◆ getNrOf()

int com.realtime.crossfire.jxclient.items.CfItem.getNrOf ( )

Returns the number of objects in this item stack.

Returns
whether the number of objects

Definition at line 337 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.nrof.

◆ getTag()

int com.realtime.crossfire.jxclient.items.CfItem.getTag ( )

◆ getTooltipText()

◆ getTooltipText1()

String com.realtime.crossfire.jxclient.items.CfItem.getTooltipText1 ( )

◆ getTooltipText2()

String com.realtime.crossfire.jxclient.items.CfItem.getTooltipText2 ( )

Returns the second line of the tooltip text.

Returns
the tooltip text

Definition at line 564 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.nrof, and com.realtime.crossfire.jxclient.items.CfItem.weight.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.getTooltipText(), and com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.selectionChanged().

+ Here is the caller graph for this function:

◆ getTooltipText3()

◆ getType()

int com.realtime.crossfire.jxclient.items.CfItem.getType ( )

Returns the type.

Returns
the type

Definition at line 453 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.type.

◆ getWeight()

int com.realtime.crossfire.jxclient.items.CfItem.getWeight ( )

Returns the weight.

Returns
the weight

Definition at line 295 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.weight.

Referenced by com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.cmdRequest().

+ Here is the caller graph for this function:

◆ isApplied()

boolean com.realtime.crossfire.jxclient.items.CfItem.isApplied ( )

Returns whether this item is applied.

Returns
whether this item is applied

Definition at line 345 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_APPLIED, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ isBlessed()

boolean com.realtime.crossfire.jxclient.items.CfItem.isBlessed ( )

Returns whether this item is blessed.

Returns
whether this item is blessed

Definition at line 361 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_BLESSED, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ isCursed()

boolean com.realtime.crossfire.jxclient.items.CfItem.isCursed ( )

Returns whether this item is cursed.

Returns
whether this item is cursed

Definition at line 385 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_CURSED, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ isDamned()

boolean com.realtime.crossfire.jxclient.items.CfItem.isDamned ( )

Returns whether this item is damned.

Returns
whether this item is damned

Definition at line 393 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_DAMNED, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ isItemGroupButton()

boolean com.realtime.crossfire.jxclient.items.CfItem.isItemGroupButton ( )

◆ isLocked()

boolean com.realtime.crossfire.jxclient.items.CfItem.isLocked ( )

Returns whether this item is locked.

Returns
whether this item is locked

Definition at line 417 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_LOCKED, and com.realtime.crossfire.jxclient.items.CfItem.flags.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button1Clicked(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button3Clicked().

+ Here is the caller graph for this function:

◆ isMagic()

boolean com.realtime.crossfire.jxclient.items.CfItem.isMagic ( )

Returns whether this item is magical.

Returns
whether this item is magical

Definition at line 377 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_MAGIC, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ isMarked()

boolean com.realtime.crossfire.jxclient.items.CfItem.isMarked ( )

Returns whether this item is marked.

Returns
whether this item is marked

Definition at line 425 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.marked.

◆ isNoPick()

boolean com.realtime.crossfire.jxclient.items.CfItem.isNoPick ( )

Returns whether this item cannot be picked up.

Returns
whether this item cannot be picked up

Definition at line 409 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_NOPICK, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ isOpen()

boolean com.realtime.crossfire.jxclient.items.CfItem.isOpen ( )

Returns whether this item is an opened container.

Returns
whether this item is an opened container

Definition at line 401 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_OPEN, and com.realtime.crossfire.jxclient.items.CfItem.flags.

Referenced by com.realtime.crossfire.jxclient.items.ItemSet.updateItem().

+ Here is the caller graph for this function:

◆ isUnidentified()

boolean com.realtime.crossfire.jxclient.items.CfItem.isUnidentified ( )

Returns whether this item is unidentified.

Returns
whether this item is unidentified

Definition at line 353 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_UNIDENTIFIED, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ isUnpaid()

boolean com.realtime.crossfire.jxclient.items.CfItem.isUnpaid ( )

Returns whether this item is unpaid.

Returns
whether this item is unpaid

Definition at line 369 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.F_UNPAID, and com.realtime.crossfire.jxclient.items.CfItem.flags.

◆ removeCfItemModifiedListener()

void com.realtime.crossfire.jxclient.items.CfItem.removeCfItemModifiedListener ( @NotNull final CfItemListener  listener)

Remove a.

CfItemModifiedListener

.

Parameters
listenerthe listener to remove

Definition at line 525 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.listeners.

◆ setAnim()

void com.realtime.crossfire.jxclient.items.CfItem.setAnim ( final int  anim)
private

Updates the animation.

Parameters
animthe new animation

Definition at line 246 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.anim, and com.realtime.crossfire.jxclient.items.CfItem.modified.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().

+ Here is the caller graph for this function:

◆ setAnimSpeed()

void com.realtime.crossfire.jxclient.items.CfItem.setAnimSpeed ( final int  animSpeed)
private

Updates the animation speed.

Parameters
animSpeedthe new animation speed

Definition at line 257 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.animSpeed, and com.realtime.crossfire.jxclient.items.CfItem.modified.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().

+ Here is the caller graph for this function:

◆ setFace()

void com.realtime.crossfire.jxclient.items.CfItem.setFace ( @NotNull final Face  face)
private

Updates the face.

Parameters
facethe new face

Definition at line 222 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.face, and com.realtime.crossfire.jxclient.items.CfItem.modified.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().

+ Here is the caller graph for this function:

◆ setFlags()

void com.realtime.crossfire.jxclient.items.CfItem.setFlags ( final int  flags)
private

Updates the flags.

Parameters
flagsthe new flags

Definition at line 200 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.flags, and com.realtime.crossfire.jxclient.items.CfItem.modified.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().

+ Here is the caller graph for this function:

◆ setLocation()

void com.realtime.crossfire.jxclient.items.CfItem.setLocation ( final int  location)

Updates the location.

Parameters
locationthe new location

Definition at line 279 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.location.

Referenced by com.realtime.crossfire.jxclient.items.ItemSet.updateItem().

+ Here is the caller graph for this function:

◆ setMarked()

void com.realtime.crossfire.jxclient.items.CfItem.setMarked ( final boolean  marked)

Sets whether this item is marked.

Parameters
markedwhether this item is marked

Definition at line 433 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.fireModified(), and com.realtime.crossfire.jxclient.items.CfItem.marked.

+ Here is the call graph for this function:

◆ setName()

void com.realtime.crossfire.jxclient.items.CfItem.setName ( @NotNull final String  name,
@NotNull final String  namePl 
)
private

Updates the name.

Parameters
namethe new singular name
namePlthe new plural name

Definition at line 234 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.modified, com.realtime.crossfire.jxclient.items.CfItem.name, and com.realtime.crossfire.jxclient.items.CfItem.namePl.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().

+ Here is the caller graph for this function:

◆ setNrOf()

void com.realtime.crossfire.jxclient.items.CfItem.setNrOf ( final int  nrof)
private

Updates the number of objects in the stack.

Parameters
nrofthe new number of objects

Definition at line 268 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.modified, and com.realtime.crossfire.jxclient.items.CfItem.nrof.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().

+ Here is the caller graph for this function:

◆ setWeight()

void com.realtime.crossfire.jxclient.items.CfItem.setWeight ( final int  weight)
private

Updates the weight.

Parameters
weightthe new weight

Definition at line 211 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.modified, and com.realtime.crossfire.jxclient.items.CfItem.weight.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().

+ Here is the caller graph for this function:

◆ update()

void com.realtime.crossfire.jxclient.items.CfItem.update ( final int  updateFlags,
final int  flags,
final int  weight,
@NotNull final Face  face,
@NotNull final String  name,
@NotNull final String  namePl,
final int  anim,
final int  animSpeed,
final int  nrof,
final boolean  clearMarked 
)

Processes an "upditem" command.

Parameters
updateFlagsthe changed values
flagsthe new flags
weightthe new weight
facethe new face
namethe new singular name
namePlthe new plural name
animthe new animation ID
animSpeedthe new animation speed
nrofthe new number of items
clearMarkedwhether the "marked" flag should be cleared

Definition at line 470 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.anim, com.realtime.crossfire.jxclient.items.CfItem.animSpeed, com.realtime.crossfire.jxclient.items.CfItem.face, com.realtime.crossfire.jxclient.items.CfItem.fireModified(), com.realtime.crossfire.jxclient.items.CfItem.flags, com.realtime.crossfire.jxclient.items.CfItem.marked, com.realtime.crossfire.jxclient.items.CfItem.name, com.realtime.crossfire.jxclient.items.CfItem.namePl, com.realtime.crossfire.jxclient.items.CfItem.nrof, com.realtime.crossfire.jxclient.items.CfItem.setAnim(), com.realtime.crossfire.jxclient.items.CfItem.setAnimSpeed(), com.realtime.crossfire.jxclient.items.CfItem.setFace(), com.realtime.crossfire.jxclient.items.CfItem.setFlags(), com.realtime.crossfire.jxclient.items.CfItem.setName(), com.realtime.crossfire.jxclient.items.CfItem.setNrOf(), com.realtime.crossfire.jxclient.items.CfItem.setWeight(), com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_ANIM, com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_ANIMSPEED, com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_FACE, com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_FLAGS, com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_NAME, com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_NROF, com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_WEIGHT, and com.realtime.crossfire.jxclient.items.CfItem.weight.

Referenced by com.realtime.crossfire.jxclient.items.ItemSet.updateItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ anim

◆ animSpeed

◆ F_APPLIED

final int com.realtime.crossfire.jxclient.items.CfItem.F_APPLIED = 0x000F
static

The flags mask for applied states.

Definition at line 111 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.isApplied().

◆ F_BLESSED

final int com.realtime.crossfire.jxclient.items.CfItem.F_BLESSED = 0x0100
static

The flags value for blessed items.

Definition at line 126 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3(), and com.realtime.crossfire.jxclient.items.CfItem.isBlessed().

◆ F_CURSED

final int com.realtime.crossfire.jxclient.items.CfItem.F_CURSED = 0x0800
static

◆ F_DAMNED

final int com.realtime.crossfire.jxclient.items.CfItem.F_DAMNED = 0x1000
static

◆ F_LOCKED

final int com.realtime.crossfire.jxclient.items.CfItem.F_LOCKED = 0x8000
static

The flags value for locked items.

Definition at line 161 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.isLocked().

◆ F_MAGIC

final int com.realtime.crossfire.jxclient.items.CfItem.F_MAGIC = 0x0400
static

The flags value for magical items.

Definition at line 136 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3(), and com.realtime.crossfire.jxclient.items.CfItem.isMagic().

◆ F_NOPICK

final int com.realtime.crossfire.jxclient.items.CfItem.F_NOPICK = 0x4000
static

The flags value for non-pickable items.

Definition at line 156 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.isNoPick().

◆ F_OPEN

final int com.realtime.crossfire.jxclient.items.CfItem.F_OPEN = 0x2000
static

The flags value for opened items.

Definition at line 151 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.isOpen().

◆ F_READ

final int com.realtime.crossfire.jxclient.items.CfItem.F_READ = 0x0020
static

The flags value for read items.

Definition at line 121 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3().

◆ F_UNIDENTIFIED

final int com.realtime.crossfire.jxclient.items.CfItem.F_UNIDENTIFIED = 0x0010
static

The flags value for unidentified items.

Definition at line 116 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3(), and com.realtime.crossfire.jxclient.items.CfItem.isUnidentified().

◆ F_UNPAID

final int com.realtime.crossfire.jxclient.items.CfItem.F_UNPAID = 0x0200
static

◆ face

◆ flags

◆ listeners

◆ location

int com.realtime.crossfire.jxclient.items.CfItem.location
private

◆ marked

boolean com.realtime.crossfire.jxclient.items.CfItem.marked
private

◆ modified

◆ name

◆ namePl

◆ nrof

◆ tag

final int com.realtime.crossfire.jxclient.items.CfItem.tag
private

◆ type

final int com.realtime.crossfire.jxclient.items.CfItem.type
private

◆ weight


The documentation for this class was generated from the following file: