|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jAsea.jAseaRun
Field Summary | |
(package private) jAseaObject[] |
alrs
|
(package private) jAseaParser[] |
commands
Parsers for each task command |
(package private) java.lang.String[] |
dirnames
An array of the cardinal direction names (Equals to dirnames4 or dirnames8, depending on the value of EightBitCompass) |
(package private) static java.lang.String[] |
dirnames4
An array of the cardinal direction names with a 4 point compass. |
(package private) static java.lang.String[] |
dirnames8
An array of the cardinal direction names with an 8 point compass. |
(package private) jAseaObject[] |
events
|
(package private) jAseaObject |
game
The game object itself. |
(package private) boolean |
gamerunning
Whether the game is running or not |
(package private) jAseaObject |
global
Copies of various fields of the "game" object. |
(package private) jAseaObject |
header
Copies of various fields of the "game" object. |
(package private) jAseaDump |
jad
Used to view an object in jAsea code |
(package private) jAseaWindow |
jaw
Window where it gets input & displays output |
(package private) jAseaLibrary[] |
lib
Parsers for each command in the standard library |
(package private) jAseaObject[] |
npcs
|
(package private) jAseaObject[] |
objects
|
(package private) PrintFilter |
os
Filters the output created by the program by substituting variables, then ALRs, then releasing |
(package private) java.util.Hashtable |
parsedExpressions
Maps strings of expressions used in TaskActions to objects of Expression class |
(package private) static java.util.Random |
r
Random Number Generator |
(package private) jAseaObject[] |
roomgroups
|
(package private) jAseaObject[] |
rooms
|
(package private) boolean |
showErrors
Debugging flag. |
(package private) jAseaGameState |
state
Current game state |
(package private) jAseaObject[] |
synonyms
|
(package private) jAseaObject[] |
tasks
|
(package private) jAseaObject[] |
vars
|
Constructor Summary | |
jAseaRun(java.lang.String filename)
Constructor. |
|
jAseaRun(java.lang.String filename,
boolean interactive)
Constructor. |
Method Summary | |
(package private) boolean |
canRunTask(int tasknum)
Is the player in a room where the task can be run? |
(package private) boolean |
canSeeEvent(jAseaObject evt)
Is the player in a room where s/he can see text from the event |
(package private) java.lang.String |
Complete(boolean b)
String representation of a boolean. |
(package private) int |
ContainerObject(int i)
The index of the 'i'th Container object. |
(package private) int |
DynamicObject(int i)
The 'i'th dynamic object. |
(package private) int |
evalExprI(java.lang.String expr)
Calculates the value of an integer expression |
(package private) java.lang.String |
evalExprS(java.lang.String expr)
Calculates the value of an String expression NOT IMPLEMENTED AT PRESENT |
(package private) void |
EventMoveObject(int obj,
int dest)
Move an object from within an event |
(package private) void |
FinishEvent(jAseaObject evt,
jAseaEventState es)
Stop event, move to finished state or restart |
(package private) void |
go()
Old main loop, obsolete |
(package private) void |
go2()
Main Loop Should really be moved to UI code |
(package private) int |
IntegerVariable(int i)
The 'i'th integer variable. |
(package private) int |
LieableObject(int i)
The 'i'th lieable object. |
(package private) void |
look(boolean was_command)
Print room description. |
static void |
main(java.lang.String[] args)
The main function. |
(package private) void |
MoveNPCToRoom(int npcnum,
int roomnum)
Move a non-player character to a room. |
(package private) void |
MoveObject(int obj,
int v2,
int v3)
Move an object to a place |
(package private) void |
MovePlayerToRoom(int roomnum)
Move player to specified room |
(package private) int |
NPCCount(int roomnum)
Return the number of characters in the room, including the player. |
(package private) boolean |
NPCInRoom(int npc,
int room)
Is a specific non-player character in a specific room? |
(package private) java.lang.String |
NPCName(int i)
Get a non-player character's name. |
(package private) boolean |
ObjectDirectlyInRoom(int objectnum,
int room)
Return whether or not an object is on the floor of a room |
(package private) boolean |
ObjectIndirectlyInRoom(int object,
int room)
Return whether an object is nested within a room - Directly in - on object indirectly in - in open object indirectly in - carried by NPC who is in said room |
(package private) boolean |
objectInPlace(int obj,
int v2,
int v3)
Is an object in a certain place, state, or condition? This documentation needs more info on all the different states that can be checked. |
(package private) java.lang.String |
ObjectLocation(int obj)
Show current location of object (Debug code only) |
(package private) java.lang.String |
ObjectName(int i)
The name of a particular object. |
(package private) java.lang.String |
ObjectStateName(jAseaObject obj,
int statenum)
The name of a particular state of the particular object. |
(package private) void |
parseLoop(java.io.BufferedReader br)
Old main loop, now obsolete |
(package private) boolean |
passTaskChar(int v1,
int v2,
int v3)
Determine whether a restriction related to character passes or not |
(package private) boolean |
passTaskObjectLocation(int v1,
int v2,
int v3)
Determine whether or not an ObjectLocation Restriction is true or not |
(package private) boolean |
passTaskObjectState(int v1,
int v2)
Determine whether a ObjectState Restriction passes or not |
(package private) boolean |
passTaskRestr(jAseaObject restr)
|
(package private) boolean |
passTaskTaskState(int v1,
int v2)
Determine whether a restriction related to TaskState passes or not |
(package private) boolean |
passTaskVar(int v1,
int v2,
int v3,
java.lang.String v4)
Determine whether a restriction related to variable state passes or not. |
(package private) boolean |
PlayerInRoom(int room)
Is the player in a specific room? |
(package private) void |
printContainerContents(int obj)
Print a list of all objects in a container (For testing only, to be disabled in production releases, or at least restricted to debug mode.) |
(package private) void |
printNPCContents(int npcnum)
Print NPC name & a list of all objects carried by, worn by, or part it. |
(package private) void |
printRoomContents(int room)
Print all objects in a room (Debug code only) |
(package private) void |
printSurfaceContents(int obj)
Print a list of all objects on a surface (For testing only, to be disabled in production releases, or at least restricted to debug mode.) |
(package private) int |
randomAdjacentRoomGroupMember(int room,
int rg)
Return a random RoomGroup member adjacent to a certain room. |
(package private) static int |
randomInt(int low,
int high)
Return a random integer between low and high boundaries. |
(package private) int |
randomRoomGroupMember(int rg)
Choose a random member of a RoomGroup |
(package private) boolean |
roomInRoomGroup(int roomnum,
int rg)
Returns whether a room is in a RoomGroup |
(package private) java.lang.String |
RoomName(int i)
The short name of a room. |
(package private) void |
runChangeObjectStateAction(int v1,
int v2)
Change the status of an object |
(package private) void |
runChangeScoreAction(int tasknum,
int v1)
Changes current score (negative changes always used, positive scores only used once) |
(package private) void |
runChangeVariableAction(int v1,
int v2,
int v3,
java.lang.String expr,
int v5)
Change the value of a variable |
(package private) void |
runEndGameAction(int v1,
int v2,
int v3)
The end of game action. |
(package private) void |
runMoveNPCAction(int v1,
int v2,
int v3)
Move the player or an NPC |
(package private) void |
runMoveObjectAction(int v1,
int v2,
int v3)
Runs a MoveObject type TaskAction |
(package private) void |
runSetTaskAction(int v1,
int v2)
Attempt to run another task |
(package private) boolean |
runTask(int tasknum,
boolean forwards)
Checks to see whether the restrictions for a task pass or not. |
(package private) void |
runTaskAction(int tasknum,
jAseaObject act)
Run a particular task action. |
void |
showError(java.lang.String s)
Print an error message to the error output. |
void |
showErrorln()
Print a newline to the error output. |
void |
showErrorln(java.lang.String s)
Print an error message to the error output, with a newline added to the end. |
(package private) void |
showRoomDesc(int roomnum)
Print the long description of a room. |
(package private) void |
ShowString(java.lang.String s)
Prints a string. |
(package private) int |
StandableObject(int i)
The 'i'th standable object. |
(package private) void |
StartEvent(int eventnum,
jAseaObject evt,
jAseaEventState es)
Change event from WAITING state to RUNNING State |
(package private) void |
StartNPCWalk(int npcnum,
int walk)
Start an NPC's walk |
(package private) int |
StatefulObject(int i)
The index of the 'i'th Openable or Statussed object. |
(package private) int |
StringVariable(int i)
The 'i'th String variable. |
(package private) int |
SurfaceObject(int i)
The index of 'i'-th Surface object. |
(package private) java.lang.String |
TaskName(int i)
The name of a task. |
(package private) void |
tickEvent(int eventnum)
Attempt to advance said event by one turn |
(package private) void |
tickNPCWalk(int npcnum)
Move NPC one step along current walk |
(package private) void |
tickTurn(java.lang.String cmd)
Run all code that results from entering a command |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
jAseaObject game
jAseaObject global
jAseaObject header
jAseaObject[] rooms
jAseaObject[] objects
jAseaObject[] tasks
jAseaObject[] events
jAseaObject[] npcs
jAseaObject[] synonyms
jAseaObject[] alrs
jAseaObject[] roomgroups
jAseaObject[] vars
jAseaGameState state
jAseaParser[] commands
jAseaLibrary[] lib
static java.util.Random r
PrintFilter os
boolean gamerunning
java.util.Hashtable parsedExpressions
jAseaWindow jaw
jAseaDump jad
boolean showErrors
static final java.lang.String[] dirnames4
static final java.lang.String[] dirnames8
java.lang.String[] dirnames
Constructor Detail |
public jAseaRun(java.lang.String filename) throws java.io.IOException
public jAseaRun(java.lang.String filename, boolean interactive) throws java.io.IOException
filename
- the game fileinteractive
- run in interactive modeMethod Detail |
void ShowString(java.lang.String s)
s
- the string to printpublic void showError(java.lang.String s)
s
- the message to printpublic void showErrorln(java.lang.String s)
s
- the message to printpublic void showErrorln()
static int randomInt(int low, int high)
low
- the low boundaryhigh
- the high boundary
boolean NPCInRoom(int npc, int room)
npc
- the non-player character indexroom
- the room index
boolean PlayerInRoom(int room)
room
- the room index
boolean canRunTask(int tasknum)
tasknum
- the task index number
boolean objectInPlace(int obj, int v2, int v3)
obj
- the object indexv2
- the type of place or state to check forv3
- more of the type of place/state to check for
boolean passTaskRestr(jAseaObject restr)
restr
- Restriction to be tested.
boolean passTaskObjectLocation(int v1, int v2, int v3)
v1
- Object Affectedv2
- Type of object Restrictionv3
- Third argument (meaning varies by v2)
boolean passTaskObjectState(int v1, int v2)
v1
- StatefulObject# to be testedv2
- State it should be in
boolean passTaskTaskState(int v1, int v2)
v1
- Task to be checkedv2
- Whether that task should be completed or not
boolean passTaskChar(int v1, int v2, int v3)
v1
- Character affectedv2
- Type of restrictionv3
- Third argument (meaning varies by v2)
int NPCCount(int roomnum)
roomnum
- the room index
boolean passTaskVar(int v1, int v2, int v3, java.lang.String v4)
v1
- Variable to be checkedv2
- meaning variesv3
- meaning variesv4
- meaning varies
boolean runTask(int tasknum, boolean forwards)
tasknum
- Number of task to be runforwards
- Is the task to be run in the forward direction?
void showRoomDesc(int roomnum)
roomnum
- the room indexvoid runTaskAction(int tasknum, jAseaObject act)
tasknum
- Number of task whose action is to be run (used only for score type actions)act
- TaskAction to be runvoid runMoveObjectAction(int v1, int v2, int v3)
v1
- Object to be movedv2
- Meaning variesv3
- Meaning variesvoid MoveObject(int obj, int v2, int v3)
obj
- Object to be movedv2
- Type of movementv3
- Meaning variesvoid MovePlayerToRoom(int roomnum)
roomnum
- the room indexvoid MoveNPCToRoom(int npcnum, int roomnum)
npcnum
- the non-player character indexroomnum
- the room index numbervoid runMoveNPCAction(int v1, int v2, int v3)
v1
- NPC to be movedv2
- Type of movementv3
- Meaning variesvoid runChangeObjectStateAction(int v1, int v2)
v1
- Stateful Object to be changedv2
- New statevoid runChangeVariableAction(int v1, int v2, int v3, java.lang.String expr, int v5)
v1
- Number of variable to be changedv2
- meaning variesv3
- meaning variesexpr
- meaning variesv5
- meaning variesint evalExprI(java.lang.String expr)
expr
- Expression to be evaluated
java.lang.String evalExprS(java.lang.String expr)
expr
- Expression to be evaluated
void runChangeScoreAction(int tasknum, int v1)
tasknum
- Number of taskv1
- Amount to change score byvoid runSetTaskAction(int v1, int v2)
v1
- whether task should be run forwards or backv2
- task to runvoid runEndGameAction(int v1, int v2, int v3)
v1
- the end state. 0 = win, 1 = lose, 2 = die.v2
- seem to be unusedv3
- seem to be unusedboolean ObjectIndirectlyInRoom(int object, int room)
object
- the object indexroom
- the room index
boolean ObjectDirectlyInRoom(int objectnum, int room)
objectnum
- the object indexroom
- the room index
int randomRoomGroupMember(int rg)
rg
- RoomGroup to pick from
int randomAdjacentRoomGroupMember(int room, int rg)
room
- the room indexrg
- RoomGroup to chooise from
boolean roomInRoomGroup(int roomnum, int rg)
roomnum
- Room #rg
- RoomGroup #
void printSurfaceContents(int obj)
obj
- SurfaceObject # to be printedvoid printContainerContents(int obj)
obj
- ContainerObject # to be printedvoid printNPCContents(int npcnum)
npcnum
- NPC to be printedjava.lang.String ObjectLocation(int obj)
obj
- Object # to be
void printRoomContents(int room)
room
- the room indexvoid go2()
void tickTurn(java.lang.String cmd)
cmd
- Command to be run.void go() throws java.io.IOException
java.io.IOException
void look(boolean was_command)
was_command
- True if the player entered "look"
If false, verbose is off, and the room is visited, be brief.void parseLoop(java.io.BufferedReader br) throws java.io.IOException
java.io.IOException
void tickEvent(int eventnum)
eventnum
- Number of Event to runboolean canSeeEvent(jAseaObject evt)
evt
- Event Number
void StartEvent(int eventnum, jAseaObject evt, jAseaEventState es)
eventnum
- #of event to startevt
- Data for eventes
- State of eventvoid FinishEvent(jAseaObject evt, jAseaEventState es)
evt
- Event Dataes
- State of eventvoid EventMoveObject(int obj, int dest)
obj
- Object # to be moveddest
- Room to move it tovoid StartNPCWalk(int npcnum, int walk)
npcnum
- NPC numberwalk
- walk to startvoid tickNPCWalk(int npcnum)
npcnum
- NPC number to movepublic static void main(java.lang.String[] args)
java.lang.String TaskName(int i)
i
- the index of the taskjava.lang.String ObjectName(int i)
i
- the index of the object
java.lang.String ObjectStateName(jAseaObject obj, int statenum)
obj
- the objectstatenum
- the state number to search for
java.lang.String RoomName(int i)
i
- the index of the room
java.lang.String NPCName(int i)
i
- the index of the character
java.lang.String Complete(boolean b)
b
- the boolean
int SurfaceObject(int i)
i
- the number of the Surface object desiredint ContainerObject(int i)
i
- the number of the ContainerObject desiredint StatefulObject(int i)
i
- the index of the object desiredint DynamicObject(int i)
i
- the index of the object desiredint StandableObject(int i)
i
- the index of the object desiredint LieableObject(int i)
i
- the index of the object desiredint IntegerVariable(int i)
i
- the index of the var desiredint StringVariable(int i)
i
- the index of the var desired
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |