Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.huguesjohnson.tiamat
Class Item

    java.lang.Object
      com.huguesjohnson.tiamat.NamedObject
          com.huguesjohnson.tiamat.Item

All Implemented Interfaces:
  Storable

public class Item
extends NamedObject
implements Storable

Item - representation of an item

Author:
  Hugues Johnson

Field Summary
`static boolean` | `DEFAULT_DISAPPEAR_ON_USE` default value for disappearOnUse property
`static boolean` | `DEFAULT_EQUIPABLE` default value for equipable property
`static boolean` | `DEFAULT_EQUIPPED` default value for equipped property

Constructor Summary
`Item(java.lang.String name, java.lang.String description)`
`Item(java.lang.String name, java.lang.String description, java.lang.String absoluteDir, java.lang.String fullImagePath, java.lang.String thumbnailImagePath)`
`Item(java.lang.String name, java.lang.String description, java.lang.String absoluteDir, java.lang.String fullImagePath, java.lang.String thumbnailImagePath, boolean equipped, boolean equipable, boolean disappearOnUse)`
`Item(java.lang.String name, java.lang.String description, java.lang.String absoluteDir, java.lang.String fullImagePath, java.lang.String thumbnailImagePath, Target[] targets)`
`Item(java.lang.String name, java.lang.String description, java.lang.String absoluteDir, java.lang.String fullImagePath, java.lang.String thumbnailImagePath, Target[] targets, boolean equipable)`
`Item(java.lang.String name, java.lang.String description, java.lang.String absoluteDir, java.lang.String fullImagePath, java.lang.String thumbnailImagePath, Target[] targets, boolean equipable, boolean disappearOnUse)`
`Item(java.lang.String name, java.lang.String description, java.lang.String absoluteDir, java.lang.String fullImagePath, java.lang.String thumbnailImagePath, Target[] targets, boolean equipped, boolean equipable, boolean disappearOnUse)`
`Item(java.lang.String name, java.lang.String description, Target[] targets)`
`Item(java.lang.String name, java.lang.String description, Target[] targets, boolean equipable)`
`Item(java.lang.String name, java.lang.String description, Target[] targets, boolean equipable, boolean disappearOnUse)`
`Item(java.lang.String name, java.lang.String description, Target[] targets, boolean equipped, boolean equipable, boolean disappearOnUse)`

Method Summary
`void` | `addTarget(Target target)` adds a Target to the collection of Targets
`boolean` | `getDisappearOnUse()`
`boolean` | `getEquipable()`
`boolean` | `getEquipped()`
`java.awt.image.BufferedImage` | `getFullImage()`
`java.lang.String` | `getFullImagePath()`
`java.lang.String` | `getFullImagePathAbsolute()`
`Target` | `getTarget(int index)`
`int` | `getTargetCount()` returns the number of targets for this item
`Target[]` | `getTargets()`
`java.awt.image.BufferedImage` | `getThumbnailImage()`
`java.lang.String` | `getThumbnailImagePath()`
`java.lang.String` | `getThumbnailImagePathAbsolute()`
`void` | `onDeserialize(Formatter formatter, java.lang.String absoluteDir)` The onDeserialize event should be fired after an object is de-serialized.
`void` | `setAbsoluteDir(java.lang.String absoluteDir)`
`void` | `setDisappearOnUse(boolean disappearOnUse)`
`void` | `setEquipable(boolean equipable)`
`void` | `setEquipped(boolean equipped)`
`void` | `setFullImagePath(java.lang.String fullImagePath)`
`void` | `setTarget(int index, Target target)`
`void` | `setTargets(Target[] targets)`
`void` | `setThumbnailImagePath(java.lang.String thumbnailImagePath)`
`java.lang.String` | `toString()` returns a string representation of the object

Methods inherited from class com.huguesjohnson.tiamat.NamedObject
`getDescription, getName, setDescription, setName`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DEFAULT_EQUIPPED

    public static final boolean DEFAULT_EQUIPPED

  default value for equipped property

  See Also:
    Constant Field Values

### DEFAULT_EQUIPABLE

    public static final boolean DEFAULT_EQUIPABLE

  default value for equipable property

  See Also:
    Constant Field Values

### DEFAULT_DISAPPEAR_ON_USE

    public static final boolean DEFAULT_DISAPPEAR_ON_USE

  default value for disappearOnUse property

  See Also:
    Constant Field Values

Constructor Detail

### Item

    public Item(java.lang.String name,
                java.lang.String description)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                Target[] targets)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                Target[] targets,
                boolean equipable)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                Target[] targets,
                boolean equipable,
                boolean disappearOnUse)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                Target[] targets,
                boolean equipped,
                boolean equipable,
                boolean disappearOnUse)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                java.lang.String absoluteDir,
                java.lang.String fullImagePath,
                java.lang.String thumbnailImagePath,
                Target[] targets,
                boolean equipped,
                boolean equipable,
                boolean disappearOnUse)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                java.lang.String absoluteDir,
                java.lang.String fullImagePath,
                java.lang.String thumbnailImagePath)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                java.lang.String absoluteDir,
                java.lang.String fullImagePath,
                java.lang.String thumbnailImagePath,
                Target[] targets)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                java.lang.String absoluteDir,
                java.lang.String fullImagePath,
                java.lang.String thumbnailImagePath,
                Target[] targets,
                boolean equipable)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                java.lang.String absoluteDir,
                java.lang.String fullImagePath,
                java.lang.String thumbnailImagePath,
                Target[] targets,
                boolean equipable,
                boolean disappearOnUse)

### Item

    public Item(java.lang.String name,
                java.lang.String description,
                java.lang.String absoluteDir,
                java.lang.String fullImagePath,
                java.lang.String thumbnailImagePath,
                boolean equipped,
                boolean equipable,
                boolean disappearOnUse)

Method Detail

### setFullImagePath

    public void setFullImagePath(java.lang.String fullImagePath)

### getFullImagePath

    public java.lang.String getFullImagePath()

### getFullImagePathAbsolute

    public java.lang.String getFullImagePathAbsolute()

### getFullImage

    public java.awt.image.BufferedImage getFullImage()

### getThumbnailImage

    public java.awt.image.BufferedImage getThumbnailImage()

### setThumbnailImagePath

    public void setThumbnailImagePath(java.lang.String thumbnailImagePath)

### getThumbnailImagePath

    public java.lang.String getThumbnailImagePath()

### getThumbnailImagePathAbsolute

    public java.lang.String getThumbnailImagePathAbsolute()

### setTargets

    public void setTargets(Target[] targets)

### getTargets

    public Target[] getTargets()

### setTarget

    public void setTarget(int index,
                          Target target)

### getTarget

    public Target getTarget(int index)

### setEquipped

    public void setEquipped(boolean equipped)

### getEquipped

    public boolean getEquipped()

### setEquipable

    public void setEquipable(boolean equipable)

### getEquipable

    public boolean getEquipable()

### setDisappearOnUse

    public void setDisappearOnUse(boolean disappearOnUse)

### getDisappearOnUse

    public boolean getDisappearOnUse()

### setAbsoluteDir

    public void setAbsoluteDir(java.lang.String absoluteDir)

### toString

    public java.lang.String toString()

  returns a string representation of the object

  Overrides:
    `toString` in class `NamedObject`

### getTargetCount

    public int getTargetCount()

  returns the number of targets for this item

### addTarget

    public void addTarget(Target target)

  adds a Target to the collection of Targets

### onDeserialize

    public void onDeserialize(Formatter formatter,
                              java.lang.String absoluteDir)

  The onDeserialize event should be fired after an object is de-serialized. This allows objects to load transient members, set their working directory, and load Storable members if needed.

  Specified by:
    `onDeserialize` in interface `Storable`
  Overrides:
    `onDeserialize` in class `NamedObject`
  Parameters:
    `formatter` - the formatter to use to load any storable members
    `absoluteDir` - the working directory since all paths stored in the object should be relative

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD