Class FixedPricePriceCalculationStrategy
java.lang.Object
games.stendhal.server.entity.npc.behaviour.impl.prices.FixedPricePriceCalculationStrategy
- All Implemented Interfaces:
PriceCalculationStrategy
Calculates prices based on a map containing item name and the fixed price
- Author:
- madmetzger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCoveredItem(String item, int price)
Add a item to the price listint
calculatePrice(Item i, Player p)
Calculate a priceint
calculatePrice(String item, Player p)
calculate a price based on the item's nameGet all item names that are covered by this calculatorboolean
Check if the given item is covered by this calculator
-
Constructor Details
-
FixedPricePriceCalculationStrategy
-
-
Method Details
-
calculatePrice
Description copied from interface:PriceCalculationStrategy
Calculate a price- Specified by:
calculatePrice
in interfacePriceCalculationStrategy
- Parameters:
i
- the item to considerp
- the player to consider for the calculation- Returns:
- the calculated price
-
calculatePrice
Description copied from interface:PriceCalculationStrategy
calculate a price based on the item's name- Specified by:
calculatePrice
in interfacePriceCalculationStrategy
- Parameters:
item
- the item namep
- the player to consider for the calculation- Returns:
- the calculated price
-
dealtItems
Description copied from interface:PriceCalculationStrategy
Get all item names that are covered by this calculator- Specified by:
dealtItems
in interfacePriceCalculationStrategy
- Returns:
- a set of item names
-
hasItem
Description copied from interface:PriceCalculationStrategy
Check if the given item is covered by this calculator- Specified by:
hasItem
in interfacePriceCalculationStrategy
- Parameters:
item
- the item name- Returns:
- true iff the item name is covered
-
addCoveredItem
Description copied from interface:PriceCalculationStrategy
Add a item to the price list- Specified by:
addCoveredItem
in interfacePriceCalculationStrategy
- Parameters:
item
- the item nameprice
- the item's price
-