Interface ItemWrangler

All Known Implementing Classes:
Administrator, Bot, Item, Mob, NormalItem, Person, Room, Shopkeeper, ShopkeeperList, User

public interface ItemWrangler
Interface on what is allowed to be done with items.
Author:
maartenl
  • Method Summary

    Modifier and Type
    Method
    Description
    addItem(Item item)
    Adds an Item to this ItemWrangler.
    boolean
    Physically destroys an item instance.
    Returns items this entity has, based on description provided.
    Retrieves a set of items that this entity has.
  • Method Details

    • getItems

      Set<Item> getItems()
      Retrieves a set of items that this entity has.
      Returns:
      A set of items.
    • findItems

      List<Item> findItems(List<String> parsed)
      Returns items this entity has, based on description provided.
      Parameters:
      parsed - the parsed description of the item, for example {"light-green", "leather", "pants"}.
      Returns:
      list of found items, empty if not found.
    • destroyItem

      boolean destroyItem(Item item)
      Physically destroys an item instance.
      Parameters:
      item - the item to be destroyed
      Returns:
      returns true, if the item was found and destroyed. False if the item was not found.
    • addItem

      Item addItem(Item item)
      Adds an Item to this ItemWrangler. It is assumed that this item has not yet been assigned to another ItemWrangler.
      Parameters:
      item - the new item. May not be null.
      Returns:
      the new item, null if unable to add.