java.lang.Objectcom.realtime.crossfire.jxclient.scripts.ScriptManager
public class ScriptManager
Maintains currently running script processes.
| Field Summary | |
|---|---|
private CommandQueue |
commandQueue
The CommandQueue for sending commands. |
private CrossfireServerConnection |
crossfireServerConnection
The CrossfireServerConnection instance. |
private FloorView |
floorView
The FloorView to use. |
private ItemSet |
itemSet
The ItemSet instance to use. |
private CfMapUpdater |
mapUpdater
The CfMapUpdater instance to use. |
private int |
nextScriptId
The script ID for the next created script. |
private java.util.Collection<ScriptProcess> |
scriptProcesses
All running ScriptProcesses. |
private SkillSet |
skillSet
The SkillSet for looking up skill names. |
private java.lang.Iterable<Spell> |
spellsManager
The spells manager instance to use. |
private Stats |
stats
The Stats instance to watch. |
| Constructor Summary | |
|---|---|
ScriptManager(CommandQueue commandQueue,
CrossfireServerConnection crossfireServerConnection,
Stats stats,
FloorView floorView,
ItemSet itemSet,
java.lang.Iterable<Spell> spellsManager,
CfMapUpdater mapUpdater,
SkillSet skillSet)
Creates a new instance. |
|
| Method Summary | |
|---|---|
private java.util.Set<ScriptProcess> |
getScriptByScriptId(int scriptId)
Returns all running scripts matching a given script ID. |
java.util.Set<ScriptProcess> |
getScripts(java.lang.String partialScriptName)
Returns all running scripts matching a given (partial) name or a script ID. |
private java.util.Set<ScriptProcess> |
getScriptsByName(java.lang.CharSequence partialScriptName)
Returns all running scripts matching a given (partial) name. |
boolean |
hasScripts()
Returns whether at least one script is running. |
void |
newScript(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 |
| Field Detail |
|---|
@NotNull private final CommandQueue commandQueue
CommandQueue for sending commands.
@NotNull private final CrossfireServerConnection crossfireServerConnection
CrossfireServerConnection instance.
@NotNull private final FloorView floorView
FloorView to use.
@NotNull private final ItemSet itemSet
ItemSet instance to use.
@NotNull private final CfMapUpdater mapUpdater
CfMapUpdater instance to use.
private int nextScriptId
@NotNull private final java.util.Collection<ScriptProcess> scriptProcesses
ScriptProcesses.
@NotNull private final SkillSet skillSet
SkillSet for looking up skill names.
@NotNull private final java.lang.Iterable<Spell> spellsManager
@NotNull private final Stats stats
Stats instance to watch.
| Constructor Detail |
|---|
public ScriptManager(@NotNull
CommandQueue commandQueue,
@NotNull
CrossfireServerConnection crossfireServerConnection,
@NotNull
Stats stats,
@NotNull
FloorView floorView,
@NotNull
ItemSet itemSet,
@NotNull
java.lang.Iterable<Spell> spellsManager,
@NotNull
CfMapUpdater mapUpdater,
@NotNull
SkillSet skillSet)
commandQueue - the command queue for sending commandscrossfireServerConnection - the connection instancestats - the stats instance to watchfloorView - the floor view to useitemSet - the item set instance to usespellsManager - the spells manager instance to usemapUpdater - the map updater instance to useskillSet - the skill set for looking up skill names| Method Detail |
|---|
@NotNull private java.util.Set<ScriptProcess> getScriptByScriptId(int scriptId)
scriptId - the script ID
@NotNull
public java.util.Set<ScriptProcess> getScripts(@NotNull
java.lang.String partialScriptName)
partialScriptName - the partial name or a script ID to match
against; an empty string matches all scripts
@NotNull
private java.util.Set<ScriptProcess> getScriptsByName(@NotNull
java.lang.CharSequence partialScriptName)
partialScriptName - the partial script name; an empty string matches
all scripts
public boolean hasScripts()
public void newScript(@NotNull
java.lang.String command)
command - the script command including arguments