Class ShopsList
java.lang.Object
games.stendhal.server.entity.npc.shop.ShopsList
Singleton class that contains inventory and prices of NPC stores.
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(String name, ShopType stype, ItemShopInventory inventory) Add an items to a shop.voidDeprecated.Shops should be defined on data/conf/shops/*.xmlvoidAdd an item to a buyer shop.voidconfigureNPC(SpeakerNPC npc, String shopname, boolean seller, boolean offer) Deprecated.voidconfigureNPC(SpeakerNPC npc, String shopname, ShopType stype, boolean offer) Configures an NPC for a shop.voidconfigureNPC(SpeakerNPC npc, String shopname, ShopType stype, Float priceFactor, boolean offer) Configures an NPC for a shop.voidconfigureNPC(String npcname, String shopname, boolean seller) Deprecated.voidconfigureNPC(String npcname, String shopname, boolean seller, boolean offer) Deprecated.voidconfigureNPC(String npcname, String shopname, ShopType stype, boolean offer) Configures an NPC for a shop.voidconfigureNPC(String npcname, String shopname, ShopType stype, Float priceFactor, boolean offer) Configures an NPC for a shop.static ShopsListget()Returns the Singleton instance.Deprecated.Gets the items offered by a shop with their prices.getContents(ShopType stype) Get list of shop contents.
-
Method Details
-
get
Returns the Singleton instance.- Returns:
- The instance
-
getContents
Get list of shop contents.- Parameters:
stype- Seller or buyer shop.- Returns:
- Seller or buyer shop list (or deprecated generic shop list if
selleris null.
-
get
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.Gets the items offered by a shop with their prices.- Parameters:
name- Shop name.- Returns:
- Item names and prices.
-
add
Add an items to a shop.- Parameters:
name- Shop name.stype- Seller, buyer, or trader shop.inventory- Item list with prices.
-
add
Deprecated.Shops should be defined on data/conf/shops/*.xmlAdd 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
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- Iftrue, adds reply to "offer".
-
configureNPC
Configures an NPC for a shop.- Parameters:
npc- NPC being configured.shopname- Shop string identifier.stype- Seller or buyer shop.offer- Iftrue, 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- Iftrue, 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- Iftrue, adds reply to "offer".
-
configureNPC
Configures an NPC for a shop.- Parameters:
npcname- Name of NPC being configured.shopname- Shop string identifier.stype- Seller or buyer shop.offer- Iftrue, 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- Iftrue, adds reply to "offer".
-
configureNPC
Deprecated.Configures an NPC for a shop.- Parameters:
seller- Seller or buyer shop.shopname- Shop string identifier.npcname- Name of NPC being configured.
-