Crossfire JXClient, Trunk
R20561
|
The representation of a Crossfire Item, client-side. More...
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< CfItemListener > | listeners = 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... | |
The representation of a Crossfire Item, client-side.
Definition at line 36 of file CfItem.java.
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 | ||
) |
Creates a new instance.
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 |
Definition at line 171 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.flags, com.realtime.crossfire.jxclient.items.CfItem.location, 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.tag, com.realtime.crossfire.jxclient.items.CfItem.type, and com.realtime.crossfire.jxclient.items.CfItem.weight.
void com.realtime.crossfire.jxclient.items.CfItem.addCfItemModifiedListener | ( | @NotNull final CfItemListener | listener | ) |
Add a.
. The listener will be notified about attribute changes of this item.
listener | the 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().
|
private |
Appends "(<ident>)" if this item has the flag.
set.
sb | the string builder to append to |
flag | the flag to check |
ident | the ident string to append |
Definition at line 551 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3().
|
private |
Notify all listener.
Definition at line 450 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.update().
Face com.realtime.crossfire.jxclient.items.CfItem.getFace | ( | ) |
Returns the face.
Definition at line 293 of file CfItem.java.
References com.realtime.crossfire.jxclient.items.CfItem.face.
int com.realtime.crossfire.jxclient.items.CfItem.getLocation | ( | ) |
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().
String com.realtime.crossfire.jxclient.items.CfItem.getName | ( | ) |
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.
int com.realtime.crossfire.jxclient.items.CfItem.getNrOf | ( | ) |
Returns the number of objects in this item stack.
Definition at line 310 of file CfItem.java.
References com.realtime.crossfire.jxclient.items.CfItem.nrof.
int com.realtime.crossfire.jxclient.items.CfItem.getTag | ( | ) |
Returns the tag.
Definition at line 276 of file CfItem.java.
References com.realtime.crossfire.jxclient.items.CfItem.tag.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button1Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button1Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button2Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button2Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button3Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button3Clicked(), com.realtime.crossfire.jxclient.items.ItemSet.cleanInventory(), com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.cmdRequest(), com.realtime.crossfire.jxclient.items.ItemSet.getItemOrPlayer(), com.realtime.crossfire.jxclient.items.ItemSet.getPlayerInventory(), com.realtime.crossfire.jxclient.items.InventoryView.InventoryView(), com.realtime.crossfire.jxclient.items.ItemSet.removeItemByTag(), com.realtime.crossfire.jxclient.items.ItemSet.reset(), com.realtime.crossfire.jxclient.items.ItemSet.updateItem(), and com.realtime.crossfire.jxclient.items.ItemsManager.upditemReceived().
String com.realtime.crossfire.jxclient.items.CfItem.getTooltipText | ( | ) |
Returns a description suitable for a tooltip text.
Definition at line 483 of file CfItem.java.
References com.realtime.crossfire.jxclient.items.CfItem.getTooltipText1(), com.realtime.crossfire.jxclient.items.CfItem.getTooltipText2(), and com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3().
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.selectionChanged(), and com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.updateTooltip().
String com.realtime.crossfire.jxclient.items.CfItem.getTooltipText1 | ( | ) |
Returns the first line of 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().
String com.realtime.crossfire.jxclient.items.CfItem.getTooltipText2 | ( | ) |
Returns the second line of 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().
String com.realtime.crossfire.jxclient.items.CfItem.getTooltipText3 | ( | ) |
Returns the third line of 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().
int com.realtime.crossfire.jxclient.items.CfItem.getType | ( | ) |
Returns the type.
Definition at line 406 of file CfItem.java.
References com.realtime.crossfire.jxclient.items.CfItem.type.
int com.realtime.crossfire.jxclient.items.CfItem.getWeight | ( | ) |
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().
boolean com.realtime.crossfire.jxclient.items.CfItem.isApplied | ( | ) |
Returns whether this item is applied.
Definition at line 318 of file CfItem.java.
boolean com.realtime.crossfire.jxclient.items.CfItem.isBlessed | ( | ) |
Returns whether this item is blessed.
Definition at line 334 of file CfItem.java.
boolean com.realtime.crossfire.jxclient.items.CfItem.isCursed | ( | ) |
Returns whether this item is cursed.
Definition at line 358 of file CfItem.java.
boolean com.realtime.crossfire.jxclient.items.CfItem.isDamned | ( | ) |
Returns whether this item is damned.
Definition at line 366 of file CfItem.java.
boolean com.realtime.crossfire.jxclient.items.CfItem.isItemGroupButton | ( | ) |
Returns whether this object is a fake object for selecting object groups in the ground view.
Definition at line 564 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button1Clicked().
boolean com.realtime.crossfire.jxclient.items.CfItem.isLocked | ( | ) |
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().
boolean com.realtime.crossfire.jxclient.items.CfItem.isMagic | ( | ) |
Returns whether this item is magical.
Definition at line 350 of file CfItem.java.
boolean com.realtime.crossfire.jxclient.items.CfItem.isNoPick | ( | ) |
Returns whether this item cannot be picked up.
Definition at line 382 of file CfItem.java.
boolean com.realtime.crossfire.jxclient.items.CfItem.isOpen | ( | ) |
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().
boolean com.realtime.crossfire.jxclient.items.CfItem.isUnidentified | ( | ) |
Returns whether this item is unidentified.
Definition at line 326 of file CfItem.java.
boolean com.realtime.crossfire.jxclient.items.CfItem.isUnpaid | ( | ) |
Returns whether this item is unpaid.
Definition at line 342 of file CfItem.java.
void com.realtime.crossfire.jxclient.items.CfItem.removeCfItemModifiedListener | ( | @NotNull final CfItemListener | listener | ) |
Remove a.
.
listener | the listener to remove |
Definition at line 474 of file CfItem.java.
References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.remove().
|
private |
Updates the animation.
anim | the 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().
|
private |
Updates the animation speed.
animSpeed | the 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().
|
private |
Updates the face.
face | the 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().
|
private |
Updates the flags.
flags | the 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().
void com.realtime.crossfire.jxclient.items.CfItem.setLocation | ( | final int | location | ) |
Updates the location.
location | the 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().
|
private |
Updates the name.
name | the new singular name |
namePl | the 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().
|
private |
Updates the number of objects in the stack.
nrof | the 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().
|
private |
Updates the weight.
weight | the 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().
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 | ||
) |
Processes an "upditem" command.
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 |
Definition at line 422 of file CfItem.java.
References com.realtime.crossfire.jxclient.items.CfItem.fireModified(), 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, and com.realtime.crossfire.jxclient.protocol.UpdItem.UPD_WEIGHT.
Referenced by com.realtime.crossfire.jxclient.items.ItemSet.updateItem().
|
private |
The animation.
Definition at line 74 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), and com.realtime.crossfire.jxclient.items.CfItem.setAnim().
|
private |
The animation speed.
Definition at line 79 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), and com.realtime.crossfire.jxclient.items.CfItem.setAnimSpeed().
|
static |
The flags mask for applied states.
Definition at line 105 of file CfItem.java.
|
static |
The flags value for blessed items.
Definition at line 115 of file CfItem.java.
|
static |
The flags value for cursed items.
Definition at line 130 of file CfItem.java.
|
static |
The flags value for damned items.
Definition at line 135 of file CfItem.java.
|
static |
The flags value for locked items.
Definition at line 150 of file CfItem.java.
|
static |
The flags value for magical items.
Definition at line 125 of file CfItem.java.
|
static |
The flags value for non-pickable items.
Definition at line 145 of file CfItem.java.
|
static |
The flags value for opened items.
Definition at line 140 of file CfItem.java.
|
static |
The flags value for unidentified items.
Definition at line 110 of file CfItem.java.
|
static |
The flags value for unpaid items.
Definition at line 120 of file CfItem.java.
|
private |
The face.
Definition at line 57 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), com.realtime.crossfire.jxclient.items.CfItem.getFace(), and com.realtime.crossfire.jxclient.items.CfItem.setFace().
|
private |
The flags.
Definition at line 46 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), and com.realtime.crossfire.jxclient.items.CfItem.setFlags().
|
private |
The listeners to be notified.
Definition at line 155 of file CfItem.java.
|
private |
The location.
Definition at line 89 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), com.realtime.crossfire.jxclient.items.CfItem.getLocation(), and com.realtime.crossfire.jxclient.items.CfItem.setLocation().
|
private |
Set if any attribute has changed since the last time listeners were notified.
Definition at line 100 of file CfItem.java.
|
private |
The singular name.
Definition at line 63 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), com.realtime.crossfire.jxclient.items.CfItem.getName(), com.realtime.crossfire.jxclient.items.CfItem.getTooltipText1(), and com.realtime.crossfire.jxclient.items.CfItem.setName().
|
private |
The plural name.
Definition at line 69 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), com.realtime.crossfire.jxclient.items.CfItem.getName(), com.realtime.crossfire.jxclient.items.CfItem.getTooltipText1(), and com.realtime.crossfire.jxclient.items.CfItem.setName().
|
private |
The number of objects in the stack.
Definition at line 84 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), com.realtime.crossfire.jxclient.items.CfItem.getNrOf(), com.realtime.crossfire.jxclient.items.CfItem.getTooltipText2(), and com.realtime.crossfire.jxclient.items.CfItem.setNrOf().
|
private |
The tag.
Definition at line 41 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), and com.realtime.crossfire.jxclient.items.CfItem.getTag().
|
private |
The type.
Definition at line 94 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), and com.realtime.crossfire.jxclient.items.CfItem.getType().
|
private |
The weight.
Definition at line 51 of file CfItem.java.
Referenced by com.realtime.crossfire.jxclient.items.CfItem.CfItem(), com.realtime.crossfire.jxclient.items.CfItem.getTooltipText2(), com.realtime.crossfire.jxclient.items.CfItem.getWeight(), and com.realtime.crossfire.jxclient.items.CfItem.setWeight().