Class PlayerLootedItemsHandler

java.lang.Object
games.stendhal.server.entity.player.PlayerLootedItemsHandler

public class PlayerLootedItemsHandler extends Object
Handling for counting looted items of a player
Author:
madmetzger
  • Field Details

    • LOOTED_ITEMS

      public static final String LOOTED_ITEMS
      name of the map where the items and the corresponding numbers are stored
      See Also:
      Constant Field Values
  • Constructor Details

    • PlayerLootedItemsHandler

      public PlayerLootedItemsHandler(Player player)
      Create a new PlayerLootedItemsHandler for a player
      Parameters:
      player -
  • Method Details

    • getNumberOfLootsForItem

      public int getNumberOfLootsForItem(String item)
      Gets the how often this PlayerLootedItemsHandler's player has looted the given item
      Parameters:
      item - the item name
      Returns:
      the number of loots from corpses
    • getQuantityOfProducedItems

      public int getQuantityOfProducedItems(String item)
      Retrieve the amount of much an item was produced by a player
      Parameters:
      item -
      Returns:
      the produced quantity
    • getQuantityOfHarvestedItems

      public int getQuantityOfHarvestedItems(String item)
      Retrieve the amount of much an item was harvested by a player
      Parameters:
      item -
      Returns:
      the harvested quantity
    • getQuantityOfBoughtItems

      public int getQuantityOfBoughtItems(String item)
      Retrieve the amount of much an item was bought by a player
      Parameters:
      item -
      Returns:
      the harvested quantity
    • getQuantityOfSoldItems

      public int getQuantityOfSoldItems(String item)
      Parameters:
      item -
      Returns:
    • getQuantityOfMinedItems

      public int getQuantityOfMinedItems(String item)
      Retrieve the amount of much an item was mined by a player
      Parameters:
      item -
      Returns:
      the mined quantity
    • incLootForItem

      public void incLootForItem(String item, int count)
      Increases the count of loots for the given item for this PlayerLootedItemsHandler's player
      Parameters:
      item - the item name
      count - the amount to increase
    • incProducedForItem

      public void incProducedForItem(String item, int count)
      Increases the count of producing for the given item for this PlayerLootedItemsHandler's player
      Parameters:
      item - the item name
      count - the amount to increase
    • incObtainedForItem

      public void incObtainedForItem(String item, int count)
      Increases the count of obtains for the given item for this PlayerLootedItemsHandler's player
      Parameters:
      item - the item name
      count - the amount to increase
    • incMinedForItem

      public void incMinedForItem(String item, int count)
      Increases the quantity an item was mined from a source like gold, coal
      Parameters:
      item -
      count -
    • incHarvestedForItem

      public void incHarvestedForItem(String item, int count)
      Increases the quantity an item was harvested
      Parameters:
      item -
      count -
    • incBoughtForItem

      public void incBoughtForItem(String item, int count)
      Increases the quantity an item was bought
      Parameters:
      item -
      count -
    • incSoldForItem

      public void incSoldForItem(String item, int count)
      Increases the quantity an item was sold
      Parameters:
      item -
      count -
    • getQuantityOfObtainedItems

      public int getQuantityOfObtainedItems()
      Returns:
      the whole number of items a player has obtained from the well