Interface PriceCalculationStrategy
- All Known Implementing Classes:
FixedPricePriceCalculationStrategy
,RepairingPriceCalculationStrategy
public interface PriceCalculationStrategy
Price calculation based on a given item and a player
- Author:
- madmetzger
-
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
-
Method Details
-
calculatePrice
Calculate a price- Parameters:
i
- the item to considerp
- the player to consider for the calculation- Returns:
- the calculated price
-
calculatePrice
calculate a price based on the item's name- Parameters:
item
- the item namep
- the player to consider for the calculation- Returns:
- the calculated price
-
dealtItems
Get all item names that are covered by this calculator- Returns:
- a set of item names
-
hasItem
Check if the given item is covered by this calculator- Parameters:
item
- the item name- Returns:
- true iff the item name is covered
-
addCoveredItem
Add a item to the price list- Parameters:
item
- the item nameprice
- the item's price
-