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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCoveredItem(String item, int price) Add a item to the price listintcalculatePrice(Item i, Player p) Calculate a priceintcalculatePrice(String item, Player p) calculate a price based on the item's nameGet all item names that are covered by this calculatorbooleanCheck if the given item is covered by this calculator
-
Constructor Details
-
FixedPricePriceCalculationStrategy
-
-
Method Details
-
calculatePrice
Description copied from interface:PriceCalculationStrategyCalculate a price- Specified by:
calculatePricein interfacePriceCalculationStrategy- Parameters:
i- the item to considerp- the player to consider for the calculation- Returns:
- the calculated price
-
calculatePrice
Description copied from interface:PriceCalculationStrategycalculate a price based on the item's name- Specified by:
calculatePricein interfacePriceCalculationStrategy- Parameters:
item- the item namep- the player to consider for the calculation- Returns:
- the calculated price
-
dealtItems
Description copied from interface:PriceCalculationStrategyGet all item names that are covered by this calculator- Specified by:
dealtItemsin interfacePriceCalculationStrategy- Returns:
- a set of item names
-
hasItem
Description copied from interface:PriceCalculationStrategyCheck if the given item is covered by this calculator- Specified by:
hasItemin interfacePriceCalculationStrategy- Parameters:
item- the item name- Returns:
- true iff the item name is covered
-
addCoveredItem
Description copied from interface:PriceCalculationStrategyAdd a item to the price list- Specified by:
addCoveredItemin interfacePriceCalculationStrategy- Parameters:
item- the item nameprice- the item's price
-