Class ShopList

java.lang.Object
games.stendhal.server.entity.npc.ShopList

public final class ShopList extends Object
Singleton class that contains inventory and prices of NPC stores.
  • Method Details

    • get

      public static ShopList get()
      Returns the Singleton instance.
      Returns:
      The instance
    • get

      public Map<String,​Integer> get(String name)
      gets the items offered by a shop with their prices
      Parameters:
      name - name of shop
      Returns:
      items and prices
    • getShops

      public Set<String> getShops()
      gets a set of all shops
      Returns:
      set of shops
    • toString

      public String toString(String name, String header)
      converts a shop into a human readable form
      Parameters:
      name - name of shop
      header - prefix
      Returns:
      human readable description
    • add

      public void add(String name, String item, int price)
      Add an item to a shop
      Parameters:
      name - the shop name
      item - the item to add
      price - the price for the item