|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.combat.slots.AbstractSlot wyvern.kernel.combat.slots.AbstractArmorSlot wyvern.kernel.combat.slots.AbstractArmorWeaponSlot
This class serves as the superclass for a body part that can hold either an armor or a weapon.
Field Summary | |
protected GameObject |
either_
|
protected java.lang.Class |
type_
|
Fields inherited from class wyvern.kernel.combat.slots.AbstractArmorSlot |
armor_ |
Fields inherited from class wyvern.kernel.combat.slots.AbstractSlot |
layer_ |
Constructor Summary | |
AbstractArmorWeaponSlot()
Constructs a new AbstractArmorWeaponSlot |
Method Summary | |
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. |
java.lang.Class |
getArmorType()
Returns the Armor subclass that this part can wear. |
protected abstract java.lang.Class |
getDefaultArmorType()
Subclasses must specify their armor type via this method. |
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 has armor or a weapon 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 the 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 |
Field Detail |
protected GameObject either_
protected java.lang.Class type_
Constructor Detail |
public AbstractArmorWeaponSlot()
Method Detail |
public boolean isEmpty()
isEmpty
in interface ItemSlot
isEmpty
in class AbstractArmorSlot
public java.lang.Class getArmorType()
getArmorType
in interface ArmorSlot
protected abstract java.lang.Class getDefaultArmorType()
public Armor getArmor()
getArmor
in interface ArmorSlot
getArmor
in class AbstractArmorSlot
public void setArmor(Armor armor)
setArmor
in interface ArmorSlot
setArmor
in class AbstractArmorSlot
public GameObject getItem()
getItem
in interface ItemSlot
getItem
in class AbstractArmorSlot
public void setItem(GameObject item)
setItem
in class AbstractArmorSlot
item
- the weapon or armor to setpublic void checkType(Armor armor)
checkType
in class AbstractArmorSlot
armor
- the armor to usepublic Weapon getWeapon()
getWeapon
in interface WeaponSlot
public void setWeapon(Weapon weapon)
setWeapon
in interface WeaponSlot
weapon
- the weapon to put in the slotpublic void remove(GameObject item)
remove
in interface ItemSlot
remove
in class AbstractArmorSlot
item
- the item to remove.
java.lang.IllegalArgumentException
- if the passed item doesn't
match the item in the slot.public java.lang.String toString()
toString
in class AbstractArmorSlot
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |