|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.rico.adventure.script.ScriptInterpreter
public class ScriptInterpreter
This class can be used to access and interpret script files in connection with a room.
| Constructor Summary | |
|---|---|
ScriptInterpreter(java.util.List<Room> rooms,
java.util.List<Conversation> cons)
Creates a new script interpreter that can be used with the specied rooms. |
|
| Method Summary | |
|---|---|
void |
bindVariable(java.lang.String scriptId,
java.lang.Object variable)
Binds a variable to the script interpreter. |
void |
invokeMethod(java.lang.String methodName)
Invoke a method from the script file the interpreter has been initialized with. |
void |
runCode(java.lang.String code)
Runs the specified scripted code. |
void |
runScript(java.lang.String scriptFile)
Executes the specified script file line by line |
void |
unbindVariable(java.lang.String scriptId)
Unbinds the variable referenced by the specified script id from the script interpreter. |
void |
updateBinding()
Updates the binding of the rooms entities to the interpreter. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScriptInterpreter(java.util.List<Room> rooms,
java.util.List<Conversation> cons)
rooms - rooms to bind to the script interpretercons - conversations to bind to the script interpreter| Method Detail |
|---|
public void updateBinding()
public void bindVariable(java.lang.String scriptId,
java.lang.Object variable)
scriptId - id to reference the object byvariable - variable to bind to the script interpreterpublic void unbindVariable(java.lang.String scriptId)
scriptId - id to reference the variable bypublic void invokeMethod(java.lang.String methodName)
methodName - method name in the script filepublic void runCode(java.lang.String code)
code - script code to runpublic void runScript(java.lang.String scriptFile)
scriptFile - script file to execute
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||