|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwyvern.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 ItemSlotisEmpty in class AbstractArmorSlotpublic java.lang.Class getArmorType()
getArmorType in interface ArmorSlotprotected abstract java.lang.Class getDefaultArmorType()
public Armor getArmor()
getArmor in interface ArmorSlotgetArmor in class AbstractArmorSlotpublic void setArmor(Armor armor)
setArmor in interface ArmorSlotsetArmor in class AbstractArmorSlotpublic GameObject getItem()
getItem in interface ItemSlotgetItem in class AbstractArmorSlotpublic void setItem(GameObject item)
setItem in class AbstractArmorSlotitem - the weapon or armor to setpublic void checkType(Armor armor)
checkType in class AbstractArmorSlotarmor - the armor to usepublic Weapon getWeapon()
getWeapon in interface WeaponSlotpublic void setWeapon(Weapon weapon)
setWeapon in interface WeaponSlotweapon - the weapon to put in the slotpublic void remove(GameObject item)
remove in interface ItemSlotremove in class AbstractArmorSlotitem - 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 | |||||||||