|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AreaGenerationLibrary
The AreaGenerationLibrary is the random generator, which takes a special flavor of xml as input to randomly generate anything from strings, to mobs and items, whole populated rooms, or entire areas. Most of the methods in this library provide a finer control to the generation process.
Nested Class Summary | |
---|---|
static class |
AreaGenerationLibrary.LayoutFlags
Enum of the type of room layoutnode |
static interface |
AreaGenerationLibrary.LayoutManager
Area generators work by first laying out a set of rooms into a configuration called a Layout. |
static interface |
AreaGenerationLibrary.LayoutNode
A layout node represents a single room in a layout manager. |
static class |
AreaGenerationLibrary.LayoutRuns
If this room layoutnode is a street type, what direction does it run? |
static class |
AreaGenerationLibrary.LayoutTags
Enum of the types of tags that room layoutnodes can be flagged with. |
static class |
AreaGenerationLibrary.LayoutTypes
Enum of the type of room layoutnode. |
Method Summary | |
---|---|
void |
buildDefinedIDSet(java.util.List<XMLLibrary.XMLTag> xmlRoot,
java.util.Map<java.lang.String,java.lang.Object> defined)
Given an area-generation xml file, this method will return all the defined tag ids. |
Room |
buildRoom(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined,
Exit[] exits,
int direction)
Given a specific ROOM generation tag, this method will return the room selected by that tag piece, with the entrace to it being in the given direction |
void |
checkRequirements(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined)
Does nothing but check the requirements to build the given xml tag piece, and compares it with the variables in the given id definition map, to see if all requirements are met. |
void |
defineReward(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined)
If an xml tag is selected manually, by something outside the library, then certain post-selection processes are not properly done, making generation based on the tag potentially impossible. |
boolean |
fillInArea(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined,
Area A,
int direction)
Given a specific AREA generation tag, and an empty area, this method will populate the area with rooms from the given tag piece, with the entrance to it being in the given direction. |
Area |
findArea(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined,
int directions)
Given a specific AREA generation tag, this method will return the area selected by that tag piece, with the entrance to it being in the given direction |
java.util.List<Item> |
findItems(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined)
Given a specific ITEM generation tag, this method will return the items selected by that tag piece. |
java.util.List<MOB> |
findMobs(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined)
Given a specific MOB generation tag, this method will return the MOBs selected by that tag piece. |
java.lang.String |
findString(java.lang.String tagName,
XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined)
Returns a string of the given tag name type, from the given top-level xml tag piece that resolves to a string, and with the given pre-defined id set. |
java.util.List<XMLLibrary.XMLTag> |
getAllChoices(java.lang.String tagName,
XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined)
Given a root xml tag and a tag name, this method will return all matching xml tag pieces. |
AreaGenerationLibrary.LayoutManager |
getLayoutManager(java.lang.String named)
Returns the layout manager of the given name. |
java.util.Map<java.lang.String,java.lang.String> |
getUnfilledRequirements(java.util.Map<java.lang.String,java.lang.Object> defined,
XMLLibrary.XMLTag piece)
Check the requirements to build the given xml tag piece, and compares it with the variables in the given id definition map, to see if all requirements are met. |
void |
postProcess(java.util.Map<java.lang.String,java.lang.Object> defined)
Sometimes an object cannot be generated at a given time because some tag which will be defined later has not yet been defined, and cannot be resolved at generation time. |
void |
preDefineReward(XMLLibrary.XMLTag piece,
java.util.Map<java.lang.String,java.lang.Object> defined)
If an xml tag is selected manually, by something outside the library, then certain pre-selection processes are not properly done, making generation based on the tag potentially impossible. |
boolean |
relevelRoom(Room room,
int oldMin,
int oldMax,
int newMin,
int newMax)
Adjusts the levels of all mobs, items, and mob-items in the room by adjusting them from their place in an existing range to a new range.Does not save -- that's up to you. |
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary |
---|
activate, getServiceClient, L, propertiesLoaded, shutdown |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
---|
copyOf, ID, initializeClass, name, newInstance |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
void buildDefinedIDSet(java.util.List<XMLLibrary.XMLTag> xmlRoot, java.util.Map<java.lang.String,java.lang.Object> defined)
xmlRoot
- the root of the area-generation xml filedefined
- a map of ids to objects, whether strings or tags.java.util.List<Item> findItems(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
piece
- the identified tag that can return itemsdefined
- the defined id set from the entire xml document
CMException
- any parsing or generation errorsbuildDefinedIDSet(List, Map)
java.util.List<MOB> findMobs(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
piece
- the identified tag that can return MOBsdefined
- the defined id set from the entire xml document
CMException
- any parsing or generation errorsbuildDefinedIDSet(List, Map)
java.lang.String findString(java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
tagName
- the name of the string tagpiece
- the top level piece, probably of type tagnamedefined
- the pre-defined id set from the entire xml document
CMException
- any parsing or generation errorsbuildDefinedIDSet(List, Map)
Room buildRoom(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, Exit[] exits, int direction) throws CMException
piece
- the identified tag that can return a roomdefined
- the defined id set from the entire xml documentexits
- pre-defined exits from this room, if anydirection
- the direction of entrance to this room
CMException
- any parsing or generation errorsbuildDefinedIDSet(List, Map)
void checkRequirements(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
piece
- the xml tag piece you want to builddefined
- the defined id set from the entire xml document, and the user
CMException
- any parsing or generation errorsjava.util.Map<java.lang.String,java.lang.String> getUnfilledRequirements(java.util.Map<java.lang.String,java.lang.Object> defined, XMLLibrary.XMLTag piece)
defined
- the defined id set from the entire xml document, and the userpiece
- the xml tag piece you want to build
Area findArea(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, int directions) throws CMException
piece
- the identified tag that can return a roomdefined
- the defined id set from the entire xml documentdirections
- the direction of entrance to this room
CMException
- any parsing or generation errorsbuildDefinedIDSet(List, Map)
boolean fillInArea(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, Area A, int direction) throws CMException
piece
- the identified tag that can return a roomdefined
- the defined id set from the entire xml documentA
- the area to put the rooms intodirection
- the direction of entrance to this room
CMException
- any parsing or generation errorsbuildDefinedIDSet(List, Map)
AreaGenerationLibrary.LayoutManager getLayoutManager(java.lang.String named)
named
- the name of the layout manager
void postProcess(java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
defined
- the defined ids after they've gone through generating an object
CMException
- any parsing or generation errorsvoid defineReward(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
piece
- the selected xml tag piecedefined
- the defined id set from the entire xml document
CMException
- any parsing or generation errorsvoid preDefineReward(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
piece
- the selected xml tag piecedefined
- the defined id set from the entire xml document
CMException
- any parsing or generation errorsjava.util.List<XMLLibrary.XMLTag> getAllChoices(java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined) throws CMException
tagName
- the name of the tag to search forpiece
- the root xml tag piecedefined
- the defined id set from the entire xml document
CMException
- any parsing or generation errorsboolean relevelRoom(Room room, int oldMin, int oldMax, int newMin, int newMax)
room
- the room to adjustoldMin
- current minimum level range for the rooms areaoldMax
- current maximum level range for the rooms areanewMin
- new minimum level range for the rooms areanewMax
- new maximum level range for the rooms area
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |