New overrides for easier item manipulation.
This commit is contained in:
@ -75,4 +75,13 @@ public final class Armor extends Item
|
||||
{
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if the item is an armor, {@code false} otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean isArmor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +92,15 @@ public final class EtcItem extends Item
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if the item is an etc item, {@code false} otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isEtcItem()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the handler name, null if no handler for item.
|
||||
*/
|
||||
|
@ -238,9 +238,36 @@ public abstract class Item extends ListenersContainer implements IIdentifiable
|
||||
*/
|
||||
public abstract ItemType getItemType();
|
||||
|
||||
/**
|
||||
* Verifies if the item is an etc item.
|
||||
* @return {@code true} if the item is an etc item, {@code false} otherwise.
|
||||
*/
|
||||
public boolean isEtcItem()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if the item is an armor.
|
||||
* @return {@code true} if the item is an armor, {@code false} otherwise.
|
||||
*/
|
||||
public boolean isArmor()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if the item is a weapon.
|
||||
* @return {@code true} if the item is a weapon, {@code false} otherwise.
|
||||
*/
|
||||
public boolean isWeapon()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if the item is a magic weapon.
|
||||
* @return {@code true} if the weapon is magic, {@code false} otherwise
|
||||
* @return {@code true} if the weapon is magic, {@code false} otherwise.
|
||||
*/
|
||||
public boolean isMagicWeapon()
|
||||
{
|
||||
|
@ -121,6 +121,15 @@ public final class Weapon extends Item
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if the item is a weapon, {@code false} otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isWeapon()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if the weapon is magic, {@code false} otherwise.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user