Class ItemParserResult

java.lang.Object
games.stendhal.common.grammar.ItemParserResult
Direct Known Subclasses:
MerchantBehaviourResult

public class ItemParserResult extends Object
Result of parsing an item name and amount by ItemParser.
  • Field Details

    • chosenItemName

      protected String chosenItemName
      The item name of the thing requested.
    • mayBeItems

      protected final Set<String> mayBeItems
      The partly matching item names.
    • amount

      protected int amount
      The amount of requested items.
  • Constructor Details

    • ItemParserResult

      public ItemParserResult(boolean found, String chosenItemName, int amount, Set<String> mayBeItems)
  • Method Details

    • wasFound

      public boolean wasFound()
      Returns:
      found flag
    • getChosenItemName

      public String getChosenItemName()
      Returns:
      the chosenItemName
    • setChosenItemName

      public void setChosenItemName(String chosenItemName)
      Parameters:
      chosenItemName - the chosenItemName to set
    • getMayBeItems

      public Set<String> getMayBeItems()
      Returns:
      the partly matching item names
    • getAmount

      public int getAmount()
    • setAmount

      public void setAmount(int amount)
      Sets the amount that the player wants to transact with the NPC.
      Parameters:
      amount - amount