wyvern.kernel.combat.slots
Class AbstractArmorSlot

java.lang.Object
  extended bywyvern.kernel.combat.slots.AbstractSlot
      extended bywyvern.kernel.combat.slots.AbstractArmorSlot
All Implemented Interfaces:
ArmorSlot, ItemSlot
Direct Known Subclasses:
AbstractArmorWeaponSlot, AmuletSlot, BodyArmorSlot, BootSlot, BracerSlot, CloakSlot, GirdleSlot, GloveSlot, HelmetSlot, RingSlot, ShieldSlot

public abstract class AbstractArmorSlot
extends AbstractSlot
implements ArmorSlot

This class serves as the superclass for armor-slot-only body parts.

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

Field Summary
protected  Armor armor_
           
 
Fields inherited from class wyvern.kernel.combat.slots.AbstractSlot
layer_
 
Constructor Summary
AbstractArmorSlot()
           
 
Method Summary
protected  void checkType(Armor armor)
          Throws an IllegalArgumentException if the armor isn't of the expected type.
 Armor getArmor()
          Gets the armor currently in the slot.
 GameObject getItem()
          Returns the item.
 boolean isEmpty()
          Returns false if this slot has armor in it.
 void remove(GameObject item)
          Removes the item in the slot.
 void setArmor(Armor armor)
          Puts the armor in the slot (nuking what was there before).
 void setItem(GameObject item)
          Sets the item in this slot.
 java.lang.String toString()
          Returns String representation.
 
Methods inherited from class wyvern.kernel.combat.slots.AbstractSlot
getLayer, setLayer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wyvern.kernel.combat.slots.ArmorSlot
getArmorType
 
Methods inherited from interface wyvern.kernel.combat.slots.ItemSlot
getLayer, setLayer
 

Field Detail

armor_

protected Armor armor_
Constructor Detail

AbstractArmorSlot

public AbstractArmorSlot()
Method Detail

isEmpty

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

Specified by:
isEmpty in interface ItemSlot
Returns:
true if the slot is empty

getArmor

public Armor getArmor()
Gets the armor currently in the slot.

Specified by:
getArmor in interface ArmorSlot
Returns:
the Armor in the slot

getItem

public GameObject getItem()
Returns the item.

Specified by:
getItem in interface ItemSlot
Returns:
the Item in the slot

setArmor

public void setArmor(Armor armor)
Puts the armor in the slot (nuking what was there before).

Specified by:
setArmor in interface ArmorSlot

setItem

public void setItem(GameObject item)
Sets the item in this slot.

Parameters:
item - the item to put in the slot (has to be Armor)

remove

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

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

checkType

protected void checkType(Armor armor)
Throws an IllegalArgumentException if the armor isn't of the expected type.


toString

public java.lang.String toString()
Returns String representation.