Class ItemParser

java.lang.Object
games.stendhal.common.grammar.ItemParser
Direct Known Subclasses:
Behaviour

public class ItemParser extends Object
  • Field Details

    • itemNames

      protected Set<String> itemNames
      ItemNames contains all valid item names.
  • Constructor Details

    • ItemParser

      public ItemParser()
    • ItemParser

      public ItemParser(Set<String> itemNames)
    • ItemParser

      public ItemParser(String itemName)
  • Method Details

    • getItemNames

      public Set<String> getItemNames()
      Returns:
      the recognized item names
    • parse

      public ItemParserResult parse(Sentence sentence)
      Search for a matching name in the available names.
      Parameters:
      sentence -
      Returns:
      parsing result
    • getErrormessage

      public String getErrormessage(ItemParserResult res, String userAction, String npcAction)
      Answer with an error message in case the request could not be fulfilled.
      Parameters:
      res -
      userAction -
      npcAction -
      Returns:
      error message