public class CfItem
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
F_APPLIED
The flags mask for applied states.
|
static int |
F_BLESSED
The flags value for blessed items.
|
static int |
F_CURSED
The flags value for cursed items.
|
static int |
F_DAMNED
The flags value for damned items.
|
static int |
F_LOCKED
The flags value for locked items.
|
static int |
F_MAGIC
The flags value for magical items.
|
static int |
F_NOPICK
The flags value for non-pickable items.
|
static int |
F_OPEN
The flags value for opened items.
|
static int |
F_READ
The flags value for read items.
|
static int |
F_UNIDENTIFIED
The flags value for unidentified items.
|
static int |
F_UNPAID
The flags value for unpaid items.
|
Constructor and Description |
---|
CfItem(int location,
int tag,
int flags,
int weight,
@NotNull Face face,
@NotNull java.lang.String name,
@NotNull java.lang.String namePl,
int anim,
int animSpeed,
int nrof,
int type)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCfItemModifiedListener(@NotNull CfItemListener listener)
Add a
CfItemModifiedListener . |
int |
getAnim()
Returns the animation.
|
int |
getAnimSpeed()
Returns the animation speed.
|
@NotNull Face |
getFace()
Returns the face.
|
int |
getLocation()
Returns the location.
|
@NotNull java.lang.String |
getName()
Returns the name.
|
int |
getNrOf()
Returns the number of objects in this item stack.
|
int |
getTag()
Returns the tag.
|
@NotNull java.lang.String |
getTooltipText()
Returns a description suitable for a tooltip text.
|
@NotNull java.lang.String |
getTooltipText1()
Returns the first line of the tooltip text.
|
@NotNull java.lang.String |
getTooltipText2()
Returns the second line of the tooltip text.
|
@NotNull java.lang.String |
getTooltipText3()
Returns the third line of the tooltip text.
|
int |
getType()
Returns the type.
|
int |
getWeight()
Returns the weight.
|
boolean |
isApplied()
Returns whether this item is applied.
|
boolean |
isBlessed()
Returns whether this item is blessed.
|
boolean |
isCursed()
Returns whether this item is cursed.
|
boolean |
isDamned()
Returns whether this item is damned.
|
boolean |
isItemGroupButton()
Returns whether this object is a fake object for selecting object groups
in the ground view.
|
boolean |
isLocked()
Returns whether this item is locked.
|
boolean |
isMagic()
Returns whether this item is magical.
|
boolean |
isMarked()
Returns whether this item is marked.
|
boolean |
isNoPick()
Returns whether this item cannot be picked up.
|
boolean |
isOpen()
Returns whether this item is an opened container.
|
boolean |
isUnidentified()
Returns whether this item is unidentified.
|
boolean |
isUnpaid()
Returns whether this item is unpaid.
|
void |
removeCfItemModifiedListener(@NotNull CfItemListener listener)
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 java.lang.String name,
@NotNull java.lang.String namePl,
int anim,
int animSpeed,
int nrof,
boolean clearMarked)
Processes an "upditem" command.
|
public static final int F_APPLIED
public static final int F_UNIDENTIFIED
public static final int F_READ
public static final int F_BLESSED
public static final int F_UNPAID
public static final int F_MAGIC
public static final int F_CURSED
public static final int F_DAMNED
public static final int F_OPEN
public static final int F_NOPICK
public static final int F_LOCKED
public CfItem(int location, int tag, int flags, int weight, @NotNull @NotNull Face face, @NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String namePl, int anim, int animSpeed, int nrof, int type)
location
- the locationtag
- the tagflags
- the flagsweight
- the weightface
- the facename
- the singular namenamePl
- the plural nameanim
- the animationanimSpeed
- the animation speednrof
- the number of objects in the stacktype
- the typepublic void setLocation(int location)
location
- the new locationpublic int getTag()
public int getWeight()
@NotNull public @NotNull Face getFace()
@NotNull public @NotNull java.lang.String getName()
public int getAnim()
public int getAnimSpeed()
public int getNrOf()
public boolean isApplied()
public boolean isUnidentified()
public boolean isBlessed()
public boolean isUnpaid()
public boolean isMagic()
public boolean isCursed()
public boolean isDamned()
public boolean isOpen()
public boolean isNoPick()
public boolean isLocked()
public boolean isMarked()
public void setMarked(boolean marked)
marked
- whether this item is markedpublic int getLocation()
public int getType()
public void update(int updateFlags, int flags, int weight, @NotNull @NotNull Face face, @NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String namePl, int anim, int animSpeed, int nrof, boolean clearMarked)
updateFlags
- the changed valuesflags
- the new flagsweight
- the new weightface
- the new facename
- the new singular namenamePl
- the new plural nameanim
- the new animation IDanimSpeed
- the new animation speednrof
- the new number of itemsclearMarked
- whether the "marked" flag should be clearedpublic void addCfItemModifiedListener(@NotNull @NotNull CfItemListener listener)
CfItemModifiedListener
. The listener will be notified about
attribute changes of this item.listener
- the listener to removepublic void removeCfItemModifiedListener(@NotNull @NotNull CfItemListener listener)
CfItemModifiedListener
.listener
- the listener to remove@NotNull public @NotNull java.lang.String getTooltipText()
@NotNull public @NotNull java.lang.String getTooltipText1()
@NotNull public @NotNull java.lang.String getTooltipText2()
@NotNull public @NotNull java.lang.String getTooltipText3()
public boolean isItemGroupButton()