wyvern.kernel.combat.slots
Interface ItemSlot

All Known Subinterfaces:
ArmorSlot, WeaponSlot
All Known Implementing Classes:
AbstractArmorSlot, AbstractArmorWeaponSlot, AbstractSlot, AbstractWeaponSlot

public interface ItemSlot

The superinterface of ArmorSlot and WeaponSlot.

Version:
1.0, Jun 11, 1998
Author:
Steve Yegge

Method Summary
 GameObject getItem()
          Returns the item (Armor or Weapon) in this slot.
 int getLayer()
          Gets the slot-layer for this slot.
 boolean isEmpty()
          Returns false if this slot has armor in it.
 void remove(GameObject item)
          Removes the item in the slot.
 void setLayer(int layer)
          Sets the slot-layer.
 

Method Detail

isEmpty

public boolean isEmpty()
Returns false if this slot has armor in it.


getItem

public GameObject getItem()
Returns the item (Armor or Weapon) in this slot.


remove

public void remove(GameObject item)
Removes the item in the slot.

Parameters:
item - the item to remove.
Throws:
java.lang.IllegalArgumentException - if the passed item doesn't match the item in the slot.

setLayer

public void setLayer(int layer)
Sets the slot-layer. Some body parts have more than one slot; e.g. a hand provides a glove-slot and a ring-slot. If the hand is wearing a glove and a ring, you shouldn't be able to remove the ring without first removing the glove. Hence layers: the ring is in a lower layer than the glove.

A slot's layer defaults to zero (0), with negative being under this slot, and a positive layer covering it.


getLayer

public int getLayer()
Gets the slot-layer for this slot.