Interface PriceCalculationStrategy

All Known Implementing Classes:
FixedPricePriceCalculationStrategy, RepairingPriceCalculationStrategy

public interface PriceCalculationStrategy
Price calculation based on a given item and a player
Author:
madmetzger
  • Method Details

    • calculatePrice

      int calculatePrice(Item i, Player p)
      Calculate a price
      Parameters:
      i - the item to consider
      p - the player to consider for the calculation
      Returns:
      the calculated price
    • calculatePrice

      int calculatePrice(String item, Player p)
      calculate a price based on the item's name
      Parameters:
      item - the item name
      p - the player to consider for the calculation
      Returns:
      the calculated price
    • dealtItems

      Set<String> dealtItems()
      Get all item names that are covered by this calculator
      Returns:
      a set of item names
    • hasItem

      boolean hasItem(String item)
      Check if the given item is covered by this calculator
      Parameters:
      item - the item name
      Returns:
      true iff the item name is covered
    • addCoveredItem

      void addCoveredItem(String item, int price)
      Add a item to the price list
      Parameters:
      item - the item name
      price - the item's price