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
ConstructorDescriptionRepairingPriceCalculationStrategy(Set<String> repairableItems)
Create a new strategy object for the given items -
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
-
RepairingPriceCalculationStrategy
Create a new strategy object for the given items- Parameters:
repairableItems
-
-
-
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
-