rle.core.board.item
Class Equipment

java.lang.Object
  extended by rle.core.vm.PlugInBase
      extended by rle.core.board.item.ItemContainerBase
          extended by rle.core.board.item.Equipment
All Implemented Interfaces:
ItemContainer, PlugIn

public class Equipment
extends ItemContainerBase

The equipment that the player is wearing.


Field Summary
protected  java.util.HashMap<java.lang.String,Item> itemMap
           
protected  java.util.LinkedHashMap<java.lang.String,InfoView> slotDescriptors
           
 
Fields inherited from class rle.core.vm.PlugInBase
config, context, parameters
 
Constructor Summary
Equipment()
           
 
Method Summary
 void add(Item item)
          Convenience method to add an item to the first available (and applicable) slot.
 void add(Item item, java.lang.String slot)
          Insert an item into a slot.
 java.util.List<java.lang.String> findApplicableSlots(Item item)
          The slots to which an item could be added if they were empty.
 java.util.List<java.lang.String> findAvailableSlots(Item item)
          The slots currently empty which would accept the item.
 Item getItem(java.lang.String slotId)
          Get the item in the specified slot, or null if the slot is empty.
 java.util.Map<java.lang.String,InfoView> getSlotDescriptors()
           
 java.lang.String getSlotId(Item item)
          Find the current slot id for an item.
 java.util.Set<Item> items()
          All items contained.
 void remove(Item item)
          Remove an item from its slot.
 Item removeItemFrom(java.lang.String slot)
          Remove an item from its slot.
 void setConfig(InfoView view)
          Overridden to configure allowable slots.
 
Methods inherited from class rle.core.board.item.ItemContainerBase
addItemContainerListener, fireItemAdded, fireItemRemoved, isEmpty, removeItemContainerListener
 
Methods inherited from class rle.core.vm.PlugInBase
config, getContext, getParameters, paramMap, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface rle.core.vm.PlugIn
config, getContext, paramMap, setParameters
 

Field Detail

slotDescriptors

protected java.util.LinkedHashMap<java.lang.String,InfoView> slotDescriptors

itemMap

protected java.util.HashMap<java.lang.String,Item> itemMap
Constructor Detail

Equipment

public Equipment()
Method Detail

items

public java.util.Set<Item> items()
All items contained.


setConfig

public void setConfig(InfoView view)
Overridden to configure allowable slots.

Specified by:
setConfig in interface PlugIn
Overrides:
setConfig in class PlugInBase

getSlotDescriptors

public java.util.Map<java.lang.String,InfoView> getSlotDescriptors()

findApplicableSlots

public java.util.List<java.lang.String> findApplicableSlots(Item item)
The slots to which an item could be added if they were empty.


findAvailableSlots

public java.util.List<java.lang.String> findAvailableSlots(Item item)
The slots currently empty which would accept the item.


getItem

public Item getItem(java.lang.String slotId)
Get the item in the specified slot, or null if the slot is empty.


add

public void add(Item item,
                java.lang.String slot)
Insert an item into a slot.


add

public void add(Item item)
Convenience method to add an item to the first available (and applicable) slot.


removeItemFrom

public Item removeItemFrom(java.lang.String slot)
Remove an item from its slot.


remove

public void remove(Item item)
Remove an item from its slot.


getSlotId

public java.lang.String getSlotId(Item item)
Find the current slot id for an item.