Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.scripts.ScriptManager Class Reference

Maintains currently running script processes. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.scripts.ScriptManager:

Public Member Functions

Set< ScriptProcessgetScripts (@NotNull final String partialScriptName)
 Returns all running scripts matching a given (partial) name or a script ID. More...
 
boolean hasScripts ()
 Returns whether at least one script is running. More...
 
void newScript (@NotNull final String command)
 Creates a new script instance. More...
 
 ScriptManager (@NotNull final CommandQueue commandQueue, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final Stats stats, @NotNull final FloorView floorView, @NotNull final ItemSet itemSet, @NotNull final Iterable< Spell > spellsManager, @NotNull final MapUpdaterState mapUpdaterState, @NotNull final SkillSet skillSet)
 Creates a new instance. More...
 

Private Member Functions

Set< ScriptProcessgetScriptByScriptId (final int scriptId)
 Returns all running scripts matching a given script ID. More...
 
Set< ScriptProcessgetScriptsByName (@NotNull final CharSequence partialScriptName)
 Returns all running scripts matching a given (partial) name. More...
 

Private Attributes

final CommandQueue commandQueue
 The CommandQueue for sending commands. More...
 
final CrossfireServerConnection crossfireServerConnection
 The CrossfireServerConnection instance. More...
 
final FloorView floorView
 The FloorView to use. More...
 
final ItemSet itemSet
 The ItemSet instance to use. More...
 
final MapUpdaterState mapUpdaterState
 The MapUpdaterState instance to use. More...
 
int nextScriptId = 1
 The script ID for the next created script. More...
 
final Collection< ScriptProcessscriptProcesses = new CopyOnWriteArraySet<>()
 All running ScriptProcesses. More...
 
final SkillSet skillSet
 The SkillSet for looking up skill names. More...
 
final Iterable< SpellspellsManager
 The spells manager instance to use. More...
 
final Stats stats
 The Stats instance to watch. More...
 

Detailed Description

Maintains currently running script processes.

Author
Andreas Kirschbaum

Definition at line 45 of file ScriptManager.java.

Constructor & Destructor Documentation

◆ ScriptManager()

com.realtime.crossfire.jxclient.scripts.ScriptManager.ScriptManager ( @NotNull final CommandQueue  commandQueue,
@NotNull final CrossfireServerConnection  crossfireServerConnection,
@NotNull final Stats  stats,
@NotNull final FloorView  floorView,
@NotNull final ItemSet  itemSet,
@NotNull final Iterable< Spell spellsManager,
@NotNull final MapUpdaterState  mapUpdaterState,
@NotNull final SkillSet  skillSet 
)

Creates a new instance.

Parameters
commandQueuethe command queue for sending commands
crossfireServerConnectionthe connection instance
statsthe stats instance to watch
floorViewthe floor view to use
itemSetthe item set instance to use
spellsManagerthe spells manager instance to use
mapUpdaterStatethe map updater state instance to use
skillSetthe skill set for looking up skill names

Definition at line 117 of file ScriptManager.java.

References com.realtime.crossfire.jxclient.scripts.ScriptManager.commandQueue, com.realtime.crossfire.jxclient.scripts.ScriptManager.crossfireServerConnection, com.realtime.crossfire.jxclient.scripts.ScriptManager.floorView, com.realtime.crossfire.jxclient.scripts.ScriptManager.itemSet, com.realtime.crossfire.jxclient.scripts.ScriptManager.mapUpdaterState, com.realtime.crossfire.jxclient.scripts.ScriptManager.skillSet, com.realtime.crossfire.jxclient.scripts.ScriptManager.spellsManager, and com.realtime.crossfire.jxclient.scripts.ScriptManager.stats.

Member Function Documentation

◆ getScriptByScriptId()

Set<ScriptProcess> com.realtime.crossfire.jxclient.scripts.ScriptManager.getScriptByScriptId ( final int  scriptId)
private

Returns all running scripts matching a given script ID.

Parameters
scriptIdthe script ID
Returns
the matching scripts, possibly empty

Definition at line 176 of file ScriptManager.java.

Referenced by com.realtime.crossfire.jxclient.scripts.ScriptManager.getScripts().

+ Here is the caller graph for this function:

◆ getScripts()

Set<ScriptProcess> com.realtime.crossfire.jxclient.scripts.ScriptManager.getScripts ( @NotNull final String  partialScriptName)

Returns all running scripts matching a given (partial) name or a script ID.

Parameters
partialScriptNamethe partial name or a script ID to match against; an empty string matches all scripts
Returns
the matching scripts, possibly empty

Definition at line 162 of file ScriptManager.java.

References com.realtime.crossfire.jxclient.scripts.ScriptManager.getScriptByScriptId(), and com.realtime.crossfire.jxclient.scripts.ScriptManager.getScriptsByName().

Referenced by com.realtime.crossfire.jxclient.commands.ScriptkillallCommand.execute(), com.realtime.crossfire.jxclient.commands.ScriptkillCommand.execute(), com.realtime.crossfire.jxclient.commands.ScriptsCommand.execute(), and com.realtime.crossfire.jxclient.commands.ScripttellCommand.execute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScriptsByName()

Set<ScriptProcess> com.realtime.crossfire.jxclient.scripts.ScriptManager.getScriptsByName ( @NotNull final CharSequence  partialScriptName)
private

Returns all running scripts matching a given (partial) name.

Parameters
partialScriptNamethe partial script name; an empty string matches all scripts
Returns
the matching scripts, possibly empty

Definition at line 194 of file ScriptManager.java.

Referenced by com.realtime.crossfire.jxclient.scripts.ScriptManager.getScripts().

+ Here is the caller graph for this function:

◆ hasScripts()

boolean com.realtime.crossfire.jxclient.scripts.ScriptManager.hasScripts ( )

◆ newScript()

void com.realtime.crossfire.jxclient.scripts.ScriptManager.newScript ( @NotNull final String  command)

Member Data Documentation

◆ commandQueue

final CommandQueue com.realtime.crossfire.jxclient.scripts.ScriptManager.commandQueue
private

The CommandQueue for sending commands.

Definition at line 51 of file ScriptManager.java.

Referenced by com.realtime.crossfire.jxclient.scripts.ScriptManager.ScriptManager().

◆ crossfireServerConnection

final CrossfireServerConnection com.realtime.crossfire.jxclient.scripts.ScriptManager.crossfireServerConnection
private

◆ floorView

final FloorView com.realtime.crossfire.jxclient.scripts.ScriptManager.floorView
private

◆ itemSet

final ItemSet com.realtime.crossfire.jxclient.scripts.ScriptManager.itemSet
private

The ItemSet instance to use.

Definition at line 75 of file ScriptManager.java.

Referenced by com.realtime.crossfire.jxclient.scripts.ScriptManager.ScriptManager().

◆ mapUpdaterState

final MapUpdaterState com.realtime.crossfire.jxclient.scripts.ScriptManager.mapUpdaterState
private

◆ nextScriptId

int com.realtime.crossfire.jxclient.scripts.ScriptManager.nextScriptId = 1
private

The script ID for the next created script.

Definition at line 104 of file ScriptManager.java.

◆ scriptProcesses

final Collection<ScriptProcess> com.realtime.crossfire.jxclient.scripts.ScriptManager.scriptProcesses = new CopyOnWriteArraySet<>()
private

All running ScriptProcesses.

Definition at line 99 of file ScriptManager.java.

◆ skillSet

final SkillSet com.realtime.crossfire.jxclient.scripts.ScriptManager.skillSet
private

The SkillSet for looking up skill names.

Definition at line 93 of file ScriptManager.java.

Referenced by com.realtime.crossfire.jxclient.scripts.ScriptManager.ScriptManager().

◆ spellsManager

final Iterable<Spell> com.realtime.crossfire.jxclient.scripts.ScriptManager.spellsManager
private

The spells manager instance to use.

Definition at line 81 of file ScriptManager.java.

Referenced by com.realtime.crossfire.jxclient.scripts.ScriptManager.ScriptManager().

◆ stats

final Stats com.realtime.crossfire.jxclient.scripts.ScriptManager.stats
private

The Stats instance to watch.

Definition at line 63 of file ScriptManager.java.

Referenced by com.realtime.crossfire.jxclient.scripts.ScriptManager.ScriptManager().


The documentation for this class was generated from the following file: