public class DefaultScriptProcess extends AbstractScriptProcess
Constructor and Description |
---|
DefaultScriptProcess(int scriptId,
@NotNull java.lang.String filename,
@NotNull CommandQueue commandQueue,
@NotNull CrossfireServerConnection crossfireServerConnection,
@NotNull Stats stats,
@NotNull FloorView floorView,
@NotNull ItemSet itemSet,
@NotNull SpellsManager spellsManager,
@NotNull MapUpdaterState mapUpdaterState,
@NotNull SkillSet skillSet)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
killScript()
Kills the script process.
|
protected @Nullable java.lang.String |
readFromScript()
Reads a line from the script process.
|
protected @Nullable java.lang.String |
waitForTermination()
Waits until the script has terminated.
|
protected void |
writeToScript(@NotNull java.lang.String data)
Sends some data to the script process.
|
addScriptProcessListener, commandSent, compareTo, equals, getFilename, getScriptId, hashCode, run, toString
public DefaultScriptProcess(int scriptId, @NotNull @NotNull java.lang.String filename, @NotNull @NotNull CommandQueue commandQueue, @NotNull @NotNull CrossfireServerConnection crossfireServerConnection, @NotNull @NotNull Stats stats, @NotNull @NotNull FloorView floorView, @NotNull @NotNull ItemSet itemSet, @NotNull @NotNull SpellsManager spellsManager, @NotNull @NotNull MapUpdaterState mapUpdaterState, @NotNull @NotNull SkillSet skillSet) throws java.io.IOException
scriptId
- the script ID identifying the new scriptfilename
- the command including arguments to executecommandQueue
- the command queue for sending commandscrossfireServerConnection
- the server connectionstats
- the stats instance to watchfloorView
- the floor view to useitemSet
- the item set instance to usespellsManager
- the spells manager instance to usemapUpdaterState
- the map updater state instance to useskillSet
- the skill set for looking up skill namesjava.io.IOException
- if the script cannot be created@Nullable protected @Nullable java.lang.String readFromScript() throws java.io.IOException
AbstractScriptProcess
readFromScript
in class AbstractScriptProcess
null
if the script has exitedjava.io.IOException
- if reading failed@Nullable protected @Nullable java.lang.String waitForTermination()
AbstractScriptProcess
waitForTermination
in class AbstractScriptProcess
null
if the script exited
normallyprotected void writeToScript(@NotNull @NotNull java.lang.String data) throws java.io.IOException
AbstractScriptProcess
writeToScript
in class AbstractScriptProcess
data
- the datajava.io.IOException
- if sending failspublic void killScript()
ScriptProcess