Class RepairingPriceCalculationStrategy
java.lang.Object
games.stendhal.server.entity.npc.behaviour.impl.prices.RepairingPriceCalculationStrategy
- All Implemented Interfaces:
PriceCalculationStrategy
Special calculation strategy for calculating repair prices
Repairing price is based on value determined by the player
level (min level has an effect similar to affecting def or rate)
and player's PK status
- Author:
- madmetzger
-
Constructor Summary
ConstructorsConstructorDescriptionRepairingPriceCalculationStrategy(Set<String> repairableItems) Create a new strategy object for the given items -
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
-
RepairingPriceCalculationStrategy
Create a new strategy object for the given items- Parameters:
repairableItems-
-
-
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
-