Class ScriptManager


  • public class ScriptManager
    extends java.lang.Object
    Maintains currently running script processes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.util.Set<ScriptProcess> getScripts​(@NotNull java.lang.String partialScriptName)
      Returns all running scripts matching a given (partial) name or a script ID.
      boolean hasScripts()
      Returns whether at least one script is running.
      void newScript​(@NotNull java.lang.String command)
      Creates a new script instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScriptManager

        public ScriptManager​(@NotNull
                             @NotNull CommandQueue commandQueue,
                             @NotNull
                             @NotNull CrossfireServerConnection crossfireServerConnection,
                             @NotNull
                             @NotNull Stats stats,
                             @NotNull
                             @NotNull FloorView floorView,
                             @NotNull
                             @NotNull ItemSet itemSet,
                             @NotNull
                             @NotNull java.lang.Iterable<Spell> spellsManager,
                             @NotNull
                             @NotNull MapUpdaterState mapUpdaterState,
                             @NotNull
                             @NotNull SkillSet skillSet)
        Creates a new instance.
        Parameters:
        commandQueue - the command queue for sending commands
        crossfireServerConnection - the connection instance
        stats - the stats instance to watch
        floorView - the floor view to use
        itemSet - the item set instance to use
        spellsManager - the spells manager instance to use
        mapUpdaterState - the map updater state instance to use
        skillSet - the skill set for looking up skill names
    • Method Detail

      • newScript

        public void newScript​(@NotNull
                              @NotNull java.lang.String command)
        Creates a new script instance.
        Parameters:
        command - the script command including arguments
      • getScripts

        @NotNull
        public @NotNull java.util.Set<ScriptProcess> getScripts​(@NotNull
                                                                @NotNull java.lang.String partialScriptName)
        Returns all running scripts matching a given (partial) name or a script ID.
        Parameters:
        partialScriptName - the partial name or a script ID to match against; an empty string matches all scripts
        Returns:
        the matching scripts, possibly empty
      • hasScripts

        public boolean hasScripts()
        Returns whether at least one script is running.
        Returns:
        whether at least one script is running