Class ShopsList

java.lang.Object
games.stendhal.server.entity.npc.shop.ShopsList

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

    • get

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

      public Map<String,ItemShopInventory> getContents(ShopType stype)
      Get list of shop contents.
      Parameters:
      stype - Seller or buyer shop.
      Returns:
      Seller or buyer shop list (or deprecated generic shop list if seller is null.
    • get

      public ItemShopInventory get(String name, ShopType stype)
      Gets the items offered by a shop with their prices.
      Parameters:
      name - Shop name.
      seller - Seller or buyer shop.
      Returns:
      Item names and prices.
    • get

      @Deprecated public Map<String,Integer> get(String name)
      Deprecated.
      Gets the items offered by a shop with their prices.
      Parameters:
      name - Shop name.
      Returns:
      Item names and prices.
    • add

      public void add(String name, ShopType stype, ItemShopInventory inventory)
      Add an items to a shop.
      Parameters:
      name - Shop name.
      stype - Seller, buyer, or trader shop.
      inventory - Item list with prices.
    • add

      @Deprecated public void add(String name, ShopType stype, String item, int price)
      Deprecated.
      Shops should be defined on data/conf/shops/*.xml
      Add an item to a shop.
      Parameters:
      name - Shop name.
      stype - Seller, buyer, or trader shop.
      item - Name of item to add.
      price - Value of the item.
    • addBuyer

      public void addBuyer(String name, String item, int price)
      Add an item to a buyer shop.
      Parameters:
      name - Shop name.
      item - Name of item to add.
      price - Value of the item.
    • configureNPC

      public void configureNPC(SpeakerNPC npc, String shopname, ShopType stype, Float priceFactor, boolean offer)
      Configures an NPC for a shop.
      Parameters:
      npc - NPC being configured.
      shopname - Shop string identifier.
      stype - Seller or buyer shop.
      priceFactor - Skews prices of all items for this merchant.
      offer - If true, adds reply to "offer".
    • configureNPC

      public void configureNPC(SpeakerNPC npc, String shopname, ShopType stype, boolean offer)
      Configures an NPC for a shop.
      Parameters:
      npc - NPC being configured.
      shopname - Shop string identifier.
      stype - Seller or buyer shop.
      offer - If true, adds reply to "offer".
    • configureNPC

      @Deprecated public void configureNPC(SpeakerNPC npc, String shopname, boolean seller, boolean offer)
      Deprecated.
      Configures an NPC for a shop.
      Parameters:
      npc - NPC being configured.
      shopname - Shop string identifier.
      seller - Seller or buyer shop.
      offer - If true, adds reply to "offer".
    • configureNPC

      public void configureNPC(String npcname, String shopname, ShopType stype, Float priceFactor, boolean offer)
      Configures an NPC for a shop.
      Parameters:
      npcname - Name of NPC being configured.
      shopname - Shop string identifier.
      stype - Seller or buyer shop.
      priceFactor - Skews prices of all items for this merchant.
      offer - If true, adds reply to "offer".
    • configureNPC

      public void configureNPC(String npcname, String shopname, ShopType stype, boolean offer)
      Configures an NPC for a shop.
      Parameters:
      npcname - Name of NPC being configured.
      shopname - Shop string identifier.
      stype - Seller or buyer shop.
      offer - If true, adds reply to "offer".
    • configureNPC

      @Deprecated public void configureNPC(String npcname, String shopname, boolean seller, boolean offer)
      Deprecated.
      Configures an NPC for a shop.
      Parameters:
      npcname - Name of NPC being configured.
      shopname - Shop string identifier.
      seller - Seller or buyer shop.
      offer - If true, adds reply to "offer".
    • configureNPC

      @Deprecated public void configureNPC(String npcname, String shopname, boolean seller)
      Deprecated.
      Configures an NPC for a shop.
      Parameters:
      seller - Seller or buyer shop.
      shopname - Shop string identifier.
      npcname - Name of NPC being configured.