wyvern.kernel.combat.slots
Class AbstractWeaponSlot

java.lang.Object
  extended bywyvern.kernel.combat.slots.AbstractSlot
      extended bywyvern.kernel.combat.slots.AbstractWeaponSlot
All Implemented Interfaces:
ItemSlot, WeaponSlot

public abstract class AbstractWeaponSlot
extends AbstractSlot
implements WeaponSlot

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

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

Field Summary
 
Fields inherited from class wyvern.kernel.combat.slots.AbstractSlot
layer_
 
Constructor Summary
AbstractWeaponSlot()
           
 
Method Summary
 GameObject getItem()
          Returns the item in this slot.
 Weapon getWeapon()
          Returns the Weapon that this part is holding.
 boolean isEmpty()
          Returns false if this slot is holding a weapon.
 void remove(GameObject item)
          Removes the item in the slot.
 void setItem(GameObject item)
          Sets the item in this slot.
 void setWeapon(Weapon weapon)
          Puts a Weapon 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.ItemSlot
getLayer, setLayer
 

Constructor Detail

AbstractWeaponSlot

public AbstractWeaponSlot()
Method Detail

isEmpty

public boolean isEmpty()
Returns false if this slot is holding a weapon.

Specified by:
isEmpty in interface ItemSlot

getWeapon

public Weapon getWeapon()
Returns the Weapon that this part is holding.

Specified by:
getWeapon in interface WeaponSlot
Returns:
the weapon we're holding, or null if none

setWeapon

public void setWeapon(Weapon weapon)
Puts a Weapon in this slot. Nukes whatever was there before; it's up to the caller to handle the old weapon.

Specified by:
setWeapon in interface WeaponSlot
Parameters:
weapon - the Weapon to place in the slot

getItem

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

Specified by:
getItem in interface ItemSlot

setItem

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


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.

toString

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