Interface SpeechFactory


public interface SpeechFactory
SpeechFactory keeps track of and creates new VocalChord instances, necessary for NPC Speech.
  • Method Details

    • getVocalChord

      VocalChord getVocalChord(Class<? extends VocalChord> clazz)
      Creates a new instance of a VocalChord
      Parameters:
      clazz - The class of the desired VocalChord
      Returns:
      a new instance of this VocalChord
    • getVocalChord

      VocalChord getVocalChord(String name)
      Creates a new instance of a VocalChord
      Parameters:
      name - The name of the desired VocalChord
      Returns:
      a new instance of this VocalChord, ornull if a VocalChord is not registered with this name
    • getVocalChordName

      String getVocalChordName(Class<? extends VocalChord> clazz)
      Returns the registered name of a VocalChord class
      Parameters:
      clazz - The VocalChord class
      Returns:
      the registered name, null if not registered
    • isRegistered

      boolean isRegistered(String name)
      Checks whether the supplied VocalChord name is registered.
      Parameters:
      name - The name of the VocalChord to check
      Returns:
      true if the VocalChord name is registered
    • newTalkableEntity

      Talkable newTalkableEntity(Entity entity)
      Creates a new Talkable entity and returns it
      Parameters:
      entity - the entity to use
      Returns:
      a Talkable entity
    • register

      void register(Class<? extends VocalChord> clazz, String name)
      Registers a VocalChord class with the SpeechController, making it available for use within. Requires a 'name', which should generally describe the intent of the VocalChord.
      Parameters:
      clazz - The VocalChord class
      name - The name of the VocalChord