com.realtime.crossfire.jxclient.settings.options
Class Pickup

java.lang.Object
  extended by com.realtime.crossfire.jxclient.settings.options.Pickup

public class Pickup
extends java.lang.Object

Defines constants for pickup mode.


Field Summary
private  CommandQueue commandQueue
          The command queue for sending pickup commands.
static long DEFAULT_PICKUP_MODE
          The default pickup mode.
private  long pickupMode
          The pickup mode.
private  java.util.Collection<PickupOption> pickupOptions
          All pickup options.
static long PU_ARMOUR
          Pickup mode: armors.
static long PU_ARROW
          Pickup mode: arrows.
static long PU_BOOTS
          Pickup mode: boots.
static long PU_BOW
          Pickup mode: bows.
static long PU_CLOAK
          Pickup mode: cloaks.
static long PU_CONTAINER
          Pickup mode: container.
static long PU_DEBUG
          Pickup mode: debug.
static long PU_DRINK
          Pickup mode: drinks.
static long PU_FLESH
          Pickup mode: flesh.
static long PU_FOOD
          Pickup mode: food.
static long PU_GLOVES
          Pickup mode: gloves.
static long PU_HELMET
          Pickup mode: helmets.
static long PU_INHIBIT
          Pickup mode: disable pickup.
static long PU_JEWELS
          Pickup mode: jewels and money.
static long PU_KEY
          Pickup mode: keys.
static long PU_MAGIC_DEVICE
          Pickup mode: magic devices.
static long PU_MAGICAL
          Pickup mode: magical items.
static long PU_MELEE_WEAPON
          Pickup mode: all weapons.
static long PU_MISSILE_WEAPON
          Pickup mode: missile weapons.
static long PU_NEW_MODE
          Pickup mode: enable newpickup mode.
static long PU_NOT_CURSED
          Pickup mode: ignore cursed items.
static long PU_NOTHING
          Pickup mode: nothing.
static long PU_POTION
          Pickup mode: potions.
static long PU_RATIO
          Pickup mode: mask for value/weight ratio.
static long PU_READABLES
          Pickup mode: normal books and scrolls.
static long PU_SHIELD
          Pickup mode: shields.
static long PU_SKILLSCROLL
          Pickup mode: skillscrolls.
static long PU_SPELLBOOK
          Pickup mode: spellbooks.
static long PU_STOP
          Pickup mode: stop before pickup.
static long PU_VALUABLES
          Pickup mode: rings and amulets.
 
Constructor Summary
Pickup(CommandQueue commandQueue, OptionManager optionManager)
          Creates a new instance.
 
Method Summary
 long getPickupMode()
          Returns the pickup mode.
private  Option newPickupOption(long option, java.lang.String tooltipText)
          Creates a new PickupOption.
 void setPickupMode(long pickupMode)
          Sets the pickup mode.
 void setPickupMode(long pickupMode, boolean set)
          Sets or unsets the pickup mode.
 void update()
          Notifies the Crossfire server and all pickup options that the pickup mode has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandQueue

@NotNull
private final CommandQueue commandQueue
The command queue for sending pickup commands.


DEFAULT_PICKUP_MODE

public static final long DEFAULT_PICKUP_MODE
The default pickup mode.

See Also:
Constant Field Values

pickupMode

private long pickupMode
The pickup mode.


pickupOptions

@NotNull
private final java.util.Collection<PickupOption> pickupOptions
All pickup options.


PU_ARMOUR

public static final long PU_ARMOUR
Pickup mode: armors.

See Also:
Constant Field Values

PU_ARROW

public static final long PU_ARROW
Pickup mode: arrows.

See Also:
Constant Field Values

PU_BOOTS

public static final long PU_BOOTS
Pickup mode: boots.

See Also:
Constant Field Values

PU_BOW

public static final long PU_BOW
Pickup mode: bows.

See Also:
Constant Field Values

PU_CLOAK

public static final long PU_CLOAK
Pickup mode: cloaks.

See Also:
Constant Field Values

PU_CONTAINER

public static final long PU_CONTAINER
Pickup mode: container.

See Also:
Constant Field Values

PU_DEBUG

public static final long PU_DEBUG
Pickup mode: debug.

See Also:
Constant Field Values

PU_DRINK

public static final long PU_DRINK
Pickup mode: drinks.

See Also:
Constant Field Values

PU_FLESH

public static final long PU_FLESH
Pickup mode: flesh.

See Also:
Constant Field Values

PU_FOOD

public static final long PU_FOOD
Pickup mode: food.

See Also:
Constant Field Values

PU_GLOVES

public static final long PU_GLOVES
Pickup mode: gloves.

See Also:
Constant Field Values

PU_HELMET

public static final long PU_HELMET
Pickup mode: helmets.

See Also:
Constant Field Values

PU_INHIBIT

public static final long PU_INHIBIT
Pickup mode: disable pickup.

See Also:
Constant Field Values

PU_JEWELS

public static final long PU_JEWELS
Pickup mode: jewels and money.

See Also:
Constant Field Values

PU_KEY

public static final long PU_KEY
Pickup mode: keys.

See Also:
Constant Field Values

PU_MAGIC_DEVICE

public static final long PU_MAGIC_DEVICE
Pickup mode: magic devices.

See Also:
Constant Field Values

PU_MAGICAL

public static final long PU_MAGICAL
Pickup mode: magical items.

See Also:
Constant Field Values

PU_MELEE_WEAPON

public static final long PU_MELEE_WEAPON
Pickup mode: all weapons.

See Also:
Constant Field Values

PU_MISSILE_WEAPON

public static final long PU_MISSILE_WEAPON
Pickup mode: missile weapons.

See Also:
Constant Field Values

PU_NEW_MODE

public static final long PU_NEW_MODE
Pickup mode: enable newpickup mode.

See Also:
Constant Field Values

PU_NOT_CURSED

public static final long PU_NOT_CURSED
Pickup mode: ignore cursed items.

See Also:
Constant Field Values

PU_NOTHING

public static final long PU_NOTHING
Pickup mode: nothing.

See Also:
Constant Field Values

PU_POTION

public static final long PU_POTION
Pickup mode: potions.

See Also:
Constant Field Values

PU_RATIO

public static final long PU_RATIO
Pickup mode: mask for value/weight ratio.

See Also:
Constant Field Values

PU_READABLES

public static final long PU_READABLES
Pickup mode: normal books and scrolls.

See Also:
Constant Field Values

PU_SHIELD

public static final long PU_SHIELD
Pickup mode: shields.

See Also:
Constant Field Values

PU_SKILLSCROLL

public static final long PU_SKILLSCROLL
Pickup mode: skillscrolls.

See Also:
Constant Field Values

PU_SPELLBOOK

public static final long PU_SPELLBOOK
Pickup mode: spellbooks.

See Also:
Constant Field Values

PU_STOP

public static final long PU_STOP
Pickup mode: stop before pickup.

See Also:
Constant Field Values

PU_VALUABLES

public static final long PU_VALUABLES
Pickup mode: rings and amulets.

See Also:
Constant Field Values
Constructor Detail

Pickup

public Pickup(@NotNull
              CommandQueue commandQueue,
              @NotNull
              OptionManager optionManager)
       throws OptionException
Creates a new instance. Registers pickup related options.

Parameters:
commandQueue - the command queue for sending pickup commands
optionManager - the option manager to use
Throws:
OptionException - if an option cannot be registered
Method Detail

getPickupMode

public long getPickupMode()
Returns the pickup mode.

Returns:
the pickup mode

newPickupOption

@NotNull
private Option newPickupOption(long option,
                                       @NotNull
                                       java.lang.String tooltipText)
Creates a new PickupOption.

Parameters:
option - the pickup value
tooltipText - the tooltip text to explain this option
Returns:
the pickup option

setPickupMode

public void setPickupMode(long pickupMode)
Sets the pickup mode. This function does not send a 'pickup command to the server.

Parameters:
pickupMode - the pickup mode

setPickupMode

public void setPickupMode(long pickupMode,
                          boolean set)
Sets or unsets the pickup mode.

Parameters:
pickupMode - the pickup mode(s) to affect
set - true=set, false=unset

update

public void update()
Notifies the Crossfire server and all pickup options that the pickup mode has changed.