Crossfire JXClient, Trunk  R20561
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...
 
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 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 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)
 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_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 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 36 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 466 of file CfItem.java.

References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.add().

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

+ Here is the call graph for this function:
+ 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 551 of file CfItem.java.

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

Notify all listener.

Definition at line 450 of file CfItem.java.

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

+ Here is the caller graph for this function:

◆ getFace()

Face com.realtime.crossfire.jxclient.items.CfItem.getFace ( )

Returns the face.

Returns
the face

Definition at line 293 of file CfItem.java.

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

◆ getLocation()

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

Returns the location.

Returns
the location

Definition at line 398 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 ( )

Returns the name.

Returns
the name

Definition at line 302 of file CfItem.java.

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

◆ 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 310 of file CfItem.java.

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

◆ getTag()

◆ getTooltipText()

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

◆ getTooltipText1()

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

Returns the first line of the tooltip text.

Returns
the tooltip text

Definition at line 504 of file CfItem.java.

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

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:

◆ getTooltipText2()

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

Returns the second line of the tooltip text.

Returns
the tooltip text

Definition at line 513 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 ( )

Returns the third line of the tooltip text.

Returns
the tooltip text

Definition at line 534 of file CfItem.java.

References com.realtime.crossfire.jxclient.items.CfItem.appendFlag().

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

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

◆ getType()

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

Returns the type.

Returns
the type

Definition at line 406 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 284 of file CfItem.java.

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

Referenced by com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.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 318 of file CfItem.java.

◆ isBlessed()

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

Returns whether this item is blessed.

Returns
whether this item is blessed

Definition at line 334 of file CfItem.java.

◆ isCursed()

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

Returns whether this item is cursed.

Returns
whether this item is cursed

Definition at line 358 of file CfItem.java.

◆ isDamned()

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

Returns whether this item is damned.

Returns
whether this item is damned

Definition at line 366 of file CfItem.java.

◆ isItemGroupButton()

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

Definition at line 564 of file CfItem.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button1Clicked().

+ Here is the caller graph for this function:

◆ isLocked()

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

Returns whether this item is locked.

Returns
whether this item is locked

Definition at line 390 of file CfItem.java.

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 350 of file CfItem.java.

◆ 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 382 of file CfItem.java.

◆ 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 374 of file CfItem.java.

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 326 of file CfItem.java.

◆ isUnpaid()

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

Returns whether this item is unpaid.

Returns
whether this item is unpaid

Definition at line 342 of file CfItem.java.

◆ removeCfItemModifiedListener()

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

Remove a.

CfItemModifiedListener

.

Parameters
listenerthe listener to remove

Definition at line 474 of file CfItem.java.

References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.remove().

+ Here is the call graph for this function:

◆ setAnim()

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

Updates the animation.

Parameters
animthe new animation

Definition at line 235 of file CfItem.java.

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

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 246 of file CfItem.java.

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

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 211 of file CfItem.java.

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

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 189 of file CfItem.java.

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

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 268 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:

◆ 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 223 of file CfItem.java.

References 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 257 of file CfItem.java.

References 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 200 of file CfItem.java.

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

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 105 of file CfItem.java.

◆ F_BLESSED

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

The flags value for blessed items.

Definition at line 115 of file CfItem.java.

◆ F_CURSED

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

The flags value for cursed items.

Definition at line 130 of file CfItem.java.

◆ F_DAMNED

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

The flags value for damned items.

Definition at line 135 of file CfItem.java.

◆ F_LOCKED

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

The flags value for locked items.

Definition at line 150 of file CfItem.java.

◆ F_MAGIC

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

The flags value for magical items.

Definition at line 125 of file CfItem.java.

◆ F_NOPICK

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

The flags value for non-pickable items.

Definition at line 145 of file CfItem.java.

◆ F_OPEN

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

The flags value for opened items.

Definition at line 140 of file CfItem.java.

◆ F_UNIDENTIFIED

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

The flags value for unidentified items.

Definition at line 110 of file CfItem.java.

◆ F_UNPAID

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

The flags value for unpaid items.

Definition at line 120 of file CfItem.java.

◆ 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

The listeners to be notified.

Definition at line 155 of file CfItem.java.

◆ location

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

◆ modified

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

Set if any attribute has changed since the last time listeners were notified.

Definition at line 100 of file CfItem.java.

◆ 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: