New overrides for easier item manipulation.

This commit is contained in:
MobiusDevelopment
2019-05-12 14:45:16 +00:00
parent 1d36174829
commit bedb7061c2
52 changed files with 715 additions and 13 deletions

View File

@ -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;
}
}

View File

@ -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.
*/

View File

@ -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()
{

View File

@ -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.
*/