Class ProducerRegister

java.lang.Object
games.stendhal.server.entity.npc.behaviour.journal.ProducerRegister

public class ProducerRegister extends Object
  • Constructor Details

    • ProducerRegister

      protected ProducerRegister()
  • Method Details

    • get

      public static ProducerRegister get()
      Singleton access method.
      Returns:
      The static instance.
    • add

      public void add(String npcName, ProducerBehaviour behaviour)
      Adds an NPC to the NPCList. Does nothing if an NPC with the same name already exists. This makes sure that each NPC can be uniquely identified by his/her name.
      Parameters:
      npcName - The NPC that should be added
      behaviour - The ProducerBehaviour of that NPC
    • add

      public void add(String npcName, MultiProducerBehaviour behaviour)
    • getProducers

      public List<Pair<String,​ProducerBehaviour>> getProducers()
    • getMultiProducers

      public List<Pair<String,​MultiProducerBehaviour>> getMultiProducers()
    • listWorkingProducers

      public String listWorkingProducers(Player player)
    • getProductionDescription

      public String getProductionDescription(Player player, String npcName)
      gets description of the production
      Parameters:
      player - player to get the description for
      npcName - name of quest
      Returns:
      details
    • getProducedItemDetails

      public String getProducedItemDetails(String itemName)
      gets description of the produced item Note: if more than one NPC makes the item, just the details of the first NPC in the list who makes it are returned
      Parameters:
      itemName - produced item
      Returns:
      details about the produced item
    • getProducedItemNames

      public List<String> getProducedItemNames(String clazz)
      gets names of all items produced, which are of the given item class (i.e. food, drink)
      Parameters:
      clazz - Item class to check
      Returns:
      list of item names
    • getWorkingProducerNames

      public List<String> getWorkingProducerNames(Player player)
      gets the names of all the NPCs to whom the player has asked to produce something
      Parameters:
      player - player to get the details for
      Returns:
      NPC names
    • getProductionDetails

      public List<String> getProductionDetails(Player player, String npcName)
      gets details on the progress of the production
      Parameters:
      player - player to get the details for
      npcName - name of quest
      Returns:
      details