|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.game.npc.plebeian.PlebeianScriptRunner
public final class PlebeianScriptRunner
WRITEME: Document this type.
| Nested Class Summary | |
|---|---|
private class |
PlebeianScriptRunner.GoToCoordRunner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.GoToNamedTargetRunner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.GoToRoomRunner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.GrantToActorRunner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.If_Runner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.PaySomeoneRunner
WRITEME: Document this type. |
(package private) class |
PlebeianScriptRunner.PopAction
WRITEME: Document this type. |
class |
PlebeianScriptRunner.Random_Runner
Run something randomly from a set of possible outcomes |
private class |
PlebeianScriptRunner.SayCasuallyRunner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.SimultaneousExecutionRunner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.StateChangeRunner
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.TestActorEquippedItem
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.TestActorHasCurrency
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.TestActorHasItem
WRITEME: Document this type. |
private static class |
PlebeianScriptRunner.TestAND
WRITEME: Document this type. |
private class |
PlebeianScriptRunner.TestIndirectContains
WRITEME: Document this type. |
private static class |
PlebeianScriptRunner.TestOR
WRITEME: Document this type. |
private static class |
PlebeianScriptRunner.TestXOR
WRITEME: Document this type. |
| Field Summary | |
|---|---|
Deque<Action> |
actions
currently-being-handled action (potentially recursive; eww.) |
Map<String,Queue<PlebeianExpression>> |
expressions
state machine stuff |
AtomicInteger |
ignoreNextStepsCounter
counter of how deeply we're ignoring the next step counter |
private long |
lastScriptTime
last time something happened |
String |
logicalState
WRITEME |
Deque<Runnable> |
toDo
Steps to be executed |
private ScriptPuppet |
victim
the NPC to which this script is running |
(package private) static String |
WS_PUNC
whitespace and whitespace-equivalent punctuation characters to be ignored in tokenizing |
| Constructor Summary | |
|---|---|
private |
PlebeianScriptRunner(AtomicInteger ignoreCounter,
String initialState,
Map<String,Queue<PlebeianExpression>> initialExpressions,
Deque<Action> initialActions,
Deque<Runnable> initialToDoItems,
ScriptPuppet puppet)
WRITEME: Document this constructor brpocock@star-hope.org |
|
PlebeianScriptRunner(ScriptPuppet master)
WRITEME: Document this constructor brpocock@star-hope.org |
| Method Summary | |
|---|---|
private PlebeianScriptConditional |
addCondition(PlebeianScriptConditional prior,
PlebeianTestConjunction conj,
PlebeianScriptConditional latter)
WRITEME: Document this method brpocock@star-hope.org |
private void |
addExpressionToState(PlebeianExpression expression)
add an expression to a state, handling autovivification if it's the first expression for that state |
private void |
addSteps(Queue<Runnable> steps,
List<Runnable> newSteps)
Add one or more steps to the given queue, running the steps together if more than one are specified. |
void |
dispatch(Action a)
WRITEME: Document this method brpocock@star-hope.org |
void |
doNextToDoItem()
Do the next script step in queue. |
protected AbstractUser |
getActorByRole(PlebeianActor rôle)
Get an actor in an active action. |
long |
getLastScriptTime()
WRITEME: Document this method brpocock@star-hope.org |
ScriptPuppet |
getPuppet()
WRITEME: Document this method brpocock@star-hope.org |
String |
getWsPunc()
|
protected void |
ignoreNextSteps(boolean whether)
|
void |
load(String login)
WRITEME: Document this method brpocock@star-hope.org |
protected void |
nextToDoItemSoon()
Do another step, soon, where “soon” is currently defined as 60ms from now |
(package private) PlebeianExpression |
parseAlwaysCommand(StringTokenizer tokens)
parse the contents of a “Always” clause |
private PlebeianScriptConditional |
parseConditional(StringTokenizer tokens)
WRITEME: Document this method brpocock@star-hope.org |
private void |
parseDeclarationCommand(String token,
StringTokenizer tokens)
Parse a top-level declaration command |
private void |
parseNote(StringTokenizer tokens)
Ignore everything up to the next “End.” token |
(package private) PlebeianScript |
parseScript(StringTokenizer tokens)
WRITEME: Document this method brpocock@star-hope.org |
(package private) PlebeianTestClause |
parseTestClause(StringTokenizer tokens)
WRITEME: Document this method brpocock@star-hope.org |
private PlebeianExpression |
parseWhenCommand(StringTokenizer tokens)
parse the contents of a “When” clause |
(package private) Action |
peekAction()
WRITEME: Document this method brpocock@star-hope.org |
void |
pushToDo(Runnable runnable)
WRITEME: Document this method brpocock@star-hope.org |
private void |
readScriptFile(File script)
WRITEME: Document this method brpocock@star-hope.org |
void |
setLastScriptTime(long when)
WRITEME: Document this method brpocock@star-hope.org |
protected void |
setLogicalState(String newState)
WRITEME: Document this method brpocock@star-hope.org |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final String WS_PUNC
public Deque<Action> actions
public Map<String,Queue<PlebeianExpression>> expressions
public AtomicInteger ignoreNextStepsCounter
private long lastScriptTime
public String logicalState
public Deque<Runnable> toDo
private final ScriptPuppet victim
| Constructor Detail |
|---|
private PlebeianScriptRunner(AtomicInteger ignoreCounter,
String initialState,
Map<String,Queue<PlebeianExpression>> initialExpressions,
Deque<Action> initialActions,
Deque<Runnable> initialToDoItems,
ScriptPuppet puppet)
ignoreCounter - WRITEMEinitialState - WRITEMEinitialExpressions - WRITEMEinitialActions - WRITEMEinitialToDoItems - WRITEMEpuppet - NPC to be puppettedpublic PlebeianScriptRunner(ScriptPuppet master)
master - WRITEME| Method Detail |
|---|
private PlebeianScriptConditional addCondition(PlebeianScriptConditional prior,
PlebeianTestConjunction conj,
PlebeianScriptConditional latter)
prior - the prior clauseconj - the conjunctionlatter - the latter clause
private void addExpressionToState(PlebeianExpression expression)
expression - the expression to be added
private void addSteps(Queue<Runnable> steps,
List<Runnable> newSteps)
steps - the queue to have the steps added to itnewSteps - the step(s) to be addedpublic void dispatch(Action a)
dispatch in interface ScriptRunnera - the action to be dispatchedpublic void doNextToDoItem()
doNextToDoItem in interface ScriptRunnerprotected AbstractUser getActorByRole(PlebeianActor rôle)
rôle - the actor's rôle
public long getLastScriptTime()
public ScriptPuppet getPuppet()
ScriptRunner
getPuppet in interface ScriptRunnerpublic String getWsPunc()
protected void ignoreNextSteps(boolean whether)
whether - shitty way to start and stop ignoring “do next
step” calls
public void load(String login)
throws GameLogicException
login - the NPC's user name (also used to find their script)
GameLogicException - usually on a syntax error or somethingprotected void nextToDoItemSoon()
PlebeianExpression parseAlwaysCommand(StringTokenizer tokens)
throws GameLogicException
tokens - tokenizer
GameLogicException - usually a syntax error
private PlebeianScriptConditional parseConditional(StringTokenizer tokens)
throws GameLogicException
tokens - token stream from script parser
GameLogicException - syntax error
private void parseDeclarationCommand(String token,
StringTokenizer tokens)
throws GameLogicException
token - the command wordtokens - the tokenizer stream containing the remainder of
the definition, which will be advanced through ti
GameLogicException - on syntax errorsprivate void parseNote(StringTokenizer tokens)
tokens - the tokenizer emitting tokens, which will be
advanced past “End.”
PlebeianScript parseScript(StringTokenizer tokens)
throws GameLogicException
tokens - WRITEME
GameLogicException - on syntax errors
PlebeianTestClause parseTestClause(StringTokenizer tokens)
throws GameLogicException
tokens - the tokenizer
GameLogicException - if the script can't be parsedprivate PlebeianExpression parseWhenCommand(StringTokenizer tokens)
tokens - tokenizer
Action peekAction()
public void pushToDo(Runnable runnable)
ScriptRunner
pushToDo in interface ScriptRunnerScriptRunner.pushToDo(java.lang.Runnable)
private void readScriptFile(File script)
throws GameLogicException
script - the script file to be read
GameLogicException - usually syntax errorpublic void setLastScriptTime(long when)
ScriptRunner
setLastScriptTime in interface ScriptRunnerScriptRunner.setLastScriptTime(long)protected void setLogicalState(String newState)
newState - the new state to be inpublic String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||