Class ItemCollector

java.lang.Object
games.stendhal.server.maps.quests.logic.ItemCollector

public class ItemCollector extends Object
Holds a list of items to collect, together with the required quantities and messages to describe them (ItemCollectorData). Uses ItemCollectorSetters to build the list in a fluent way. Example usage:
 new ItemCollector().require().item("wood").pieces(2).bySaying("Bring me %s, please.");
 
  • Constructor Details

    • ItemCollector

      public ItemCollector()
  • Method Details

    • require

      public ItemCollectorSetters require()
      Starts adding a new required item. Returns an ItemCollectorSetters to allow describing the required item in a fluent way. It may add a single item. To build a list of different items, call the method multiple times. See the class documentation for example usage.
      Returns:
      the collector setters
    • requiredItems

      public List<ItemCollectorData> requiredItems()
      Gets the list of required items, in the order that they were added by subsequent calls to require().
      Returns:
      a list of items to collect