Crossfire JXClient, Trunk
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.items.CfItem Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.items.CfItem:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.items.CfItem:
Collaboration graph

Public Member Functions

void addCfItemModifiedListener (@NotNull final CfItemListener listener)
 
 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)
 
int getAnim ()
 
int getAnimSpeed ()
 
Face getFace ()
 
int getLocation ()
 
String getName ()
 
int getNrOf ()
 
int getTag ()
 
String getTooltipText ()
 
String getTooltipText1 ()
 
String getTooltipText2 ()
 
String getTooltipText3 ()
 
int getType ()
 
int getWeight ()
 
boolean isApplied ()
 
boolean isBlessed ()
 
boolean isCursed ()
 
boolean isDamned ()
 
boolean isItemGroupButton ()
 
boolean isLocked ()
 
boolean isMagic ()
 
boolean isMarked ()
 
boolean isNoPick ()
 
boolean isOpen ()
 
boolean isUnidentified ()
 
boolean isUnpaid ()
 
void removeCfItemModifiedListener (@NotNull final CfItemListener listener)
 
void setLocation (final int location)
 
void setMarked (final boolean marked)
 
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)
 

Static Public Attributes

static final int F_APPLIED = 0x000F
 
static final int F_BLESSED = 0x0100
 
static final int F_CURSED = 0x0800
 
static final int F_DAMNED = 0x1000
 
static final int F_LOCKED = 0x8000
 
static final int F_MAGIC = 0x0400
 
static final int F_NOPICK = 0x4000
 
static final int F_OPEN = 0x2000
 
static final int F_READ = 0x0020
 
static final int F_UNIDENTIFIED = 0x0010
 
static final int F_UNPAID = 0x0200
 

Private Member Functions

void appendFlag (@NotNull final StringBuilder sb, final int flag, @NotNull final String ident)
 
void fireModified ()
 
void setAnim (final int anim)
 
void setAnimSpeed (final int animSpeed)
 
void setFace (@NotNull final Face face)
 
void setFlags (final int flags)
 
void setName (@NotNull final String name, @NotNull final String namePl)
 
void setNrOf (final int nrof)
 
void setWeight (final int weight)
 

Private Attributes

int anim
 
int animSpeed
 
Face face
 
int flags
 
final EventListenerList2< CfItemListenerlisteners = new EventListenerList2<>()
 
int location
 
boolean marked
 
boolean modified = true
 
String name
 
String namePl
 
int nrof
 
final int tag
 
final int type
 
int weight
 

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()

Face com.realtime.crossfire.jxclient.items.CfItem.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()

String com.realtime.crossfire.jxclient.items.CfItem.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()

String com.realtime.crossfire.jxclient.items.CfItem.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

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

◆ animSpeed

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

◆ 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

Face com.realtime.crossfire.jxclient.items.CfItem.face
private

◆ flags

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

◆ listeners

final EventListenerList2<CfItemListener> com.realtime.crossfire.jxclient.items.CfItem.listeners = new EventListenerList2<>()
private

◆ location

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

◆ marked

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

◆ modified

boolean com.realtime.crossfire.jxclient.items.CfItem.modified = true
private

◆ name

String com.realtime.crossfire.jxclient.items.CfItem.name
private

◆ namePl

String com.realtime.crossfire.jxclient.items.CfItem.namePl
private

◆ nrof

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

◆ tag

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

◆ type

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

◆ weight

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

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