|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.Vector
|
+--mstar.MudMap
A class that implements a general map for storing information about each room in the collaborative environment, and a set of methods for searching for rooms, and objects in the map. In addition there are a set of methods for reading and writing the maps to disk in both Java object format and psuedo-MAAS-Neotek format.
| Fields inherited from class java.util.Vector |
capacityIncrement,
elementCount,
elementData |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
MudMap()
Create an empty MUD map. |
|
MudMap(Room room)
Create a MUD map and add the specified room. |
|
| Method Summary | |
void |
add(Room room)
Adds a room to the map and writes the map back to disk. |
void |
clearRoomsVisited()
Clears the visited flag in each of the rooms in the map. |
void |
clearVisitedExits()
Clears the visited exits field of each room in the map. |
void |
fastAdd(Room room)
Adds a room to the map but does not write the maps to disk. |
java.util.Vector |
findObject(java.lang.String object)
Finds all of the rooms in the map that contain object. |
java.util.Stack |
findPath(int start,
int destination)
Given two room identifiers return a Stack that has a set of directions to go from one room to the other. |
java.util.Stack |
findPath(Room start,
Room destination)
Given two rooms return a Stack that has a set of directions to go from one room to the other. |
java.util.Stack |
findPathToRoom(int start,
int destination)
Given two room identifiers return a Stack that has a set of directions to go from one room to the other. |
java.util.Stack |
findPathToRoom(Room start,
Room destination)
Given two rooms return a Stack that has a set of directions to go from one room to the other. |
Room |
getCurrentRoom()
Gets the robot's current room in the MUD. |
Room |
getHome()
Gets the room that is the robot's home or default room in the collaborative environment. |
int |
getId()
Returns the room identifier for the next room. |
java.lang.String |
getMapFilename()
Gets the output filename for the map. |
Room |
getPreviousRoom()
Gets the last room that the robot was in. |
Room |
getRoom(int id)
Given the id of a room in the map locate and return that room. |
Room |
getRoom(Room r)
Given a room find the same room in the map. |
Room |
getRoom(java.lang.String name)
Locate a room in the map with the given name. |
Room |
getRoomWithUnexploredExits()
Starting from the beginning of the map, locate a room that has unexplored exits. |
Room |
getRoomWithUnexploredExits(int after)
Starting from the id greater than after, locate a room that has unexplored exits. |
static MudMap |
loadMap()
Loads the MUD map from disk. |
java.lang.String |
makeDirections(int start,
java.util.Stack s)
This routine runs through the stack backwards and creates a set of human readable directions that the bot is following to go to the destination. |
void |
readMap()
Deprecated. |
boolean |
roomExists(int id)
Determines if a room in the map exists with the given id. |
boolean |
roomExists(Room theRoom)
Determines if a room in the map exists given another room. |
boolean |
roomExists(java.lang.String name)
Determines if a room in the map exists with the given name. |
void |
setCurrentRoom(Room currentRoom)
Sets the robot's current room in the MUD. |
void |
setFallbackExits(java.lang.String[] exits)
Sets the list of fallback exits to use. |
void |
setHome(Room home)
Sets the room that is the robot's home or default room in the collaborative environment. |
void |
setMapFilename(java.lang.String mapFilename)
Set the output filename for the map. |
void |
setPreviousRoom(Room previousRoom)
Sets the last room that the robot was in. |
void |
setUseFallbackExits(boolean t)
Sets whether or not to use fallback exits. |
void |
setUsePossibleExits(boolean t)
Sets whether or not to use possible exits. |
java.lang.String |
toString()
Returns a string representation of the map. |
void |
WriteMap()
Writes the map out in pseudo-MAAS-Neotek format. |
void |
WriteMapAsObjects()
Writes the map out to disk as a set of Java objects. |
| Methods inherited from class java.util.Vector |
add,
add,
addAll,
addAll,
addElement,
capacity,
clear,
clone,
contains,
containsAll,
copyInto,
elementAt,
elements,
ensureCapacity,
equals,
firstElement,
get,
hashCode,
indexOf,
indexOf,
insertElementAt,
isEmpty,
lastElement,
lastIndexOf,
lastIndexOf,
remove,
remove,
removeAll,
removeAllElements,
removeElement,
removeElementAt,
removeRange,
retainAll,
set,
setElementAt,
setSize,
size,
subList,
toArray,
toArray,
trimToSize |
| Methods inherited from class java.util.AbstractList |
iterator,
listIterator,
listIterator |
| Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public MudMap()
public MudMap(Room room)
room - the room to be added to the MUD map.| Method Detail |
public int getId()
public void setCurrentRoom(Room currentRoom)
currentRoom - the room that is the robot's current position in
the MUD.public Room getCurrentRoom()
public void setPreviousRoom(Room previousRoom)
previousRoom - the room that the robot was in before the
current room.public Room getPreviousRoom()
public void setHome(Room home)
home - the room that is the robot's home or default room in
the collaborative environment.public Room getHome()
public void setUseFallbackExits(boolean t)
t - if true use fallback exits to locate exits. If false do
not use the fallback exit list.public void setUsePossibleExits(boolean t)
t - if true use possible exits to locate exits. If false do
not use the possible exit list.public void setFallbackExits(java.lang.String[] exits)
exits - a String array of exit names to use when fallback
exits are enabled.public static MudMap loadMap()
public void add(Room room)
room - the room to add to the the map.public void fastAdd(Room room)
room - the room to add to the map.public Room getRoom(Room r)
r - the room to locate in the map.public Room getRoom(int id)
id - of the room to locate in the map.public Room getRoomWithUnexploredExits()
public Room getRoomWithUnexploredExits(int after)
public Room getRoom(java.lang.String name)
name - the name of the room to locate.public boolean roomExists(java.lang.String name)
name - of the room to check for.public boolean roomExists(int id)
id - of the room to check for.public boolean roomExists(Room theRoom)
theRoom - to check the map for.public java.lang.String toString()
public void clearVisitedExits()
public void setMapFilename(java.lang.String mapFilename)
public java.lang.String getMapFilename()
public void WriteMapAsObjects()
public void WriteMap()
public void clearRoomsVisited()
public java.util.Stack findPath(Room start,
Room destination)
start - the starting roomdestination - the destination room
public java.util.Stack findPath(int start,
int destination)
start - the identifier of the starting room.destination - the identifier of the destination room.
public java.util.Stack findPathToRoom(int start,
int destination)
start - the identifier of the starting room.destination - the identifier of the destination room.
public java.util.Stack findPathToRoom(Room start,
Room destination)
start - the starting roomdestination - the destination room
public java.lang.String makeDirections(int start,
java.util.Stack s)
start - the index of the room the bot is starting from.s - the stack that has the directionspublic java.util.Vector findObject(java.lang.String object)
object - a String representing the object in the MUD to be
located.public void readMap()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||