com.planet_ink.coffee_mud.Libraries
Class MUDPercolator

java.lang.Object
  extended by com.planet_ink.coffee_mud.Libraries.StdLibrary
      extended by com.planet_ink.coffee_mud.Libraries.MUDPercolator
All Implemented Interfaces:
CMObject, Tickable, AreaGenerationLibrary, CMLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class MUDPercolator
extends StdLibrary
implements AreaGenerationLibrary


Nested Class Summary
protected  class MUDPercolator.PostProcessAttempt
           
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.AreaGenerationLibrary
AreaGenerationLibrary.LayoutFlags, AreaGenerationLibrary.LayoutManager, AreaGenerationLibrary.LayoutNode, AreaGenerationLibrary.LayoutRuns, AreaGenerationLibrary.LayoutTags, AreaGenerationLibrary.LayoutTypes
 
Field Summary
protected static Triad<java.lang.Integer,java.lang.Integer,java.lang.Class<?>[]> emptyMetacraftFilter
           
protected static java.lang.String POST_PROCESSING_STAT_SETS
           
protected static CMParms.DelimiterChecker REQUIRES_DELIMITERS
           
protected static char[] splitters
           
protected static java.util.Set<java.lang.String> UPPER_REQUIRES_KEYWORDS
           
 
Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
isDebugging, name, serviceClient, tickStatus
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
MUDPercolator()
           
 
Method Summary
 boolean activate()
          Activates the library.
protected  void addDefinition(java.lang.String definition, java.lang.String value, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  Ability buildAbility(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  Area buildArea(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, int direction)
           
protected  Behavior buildBehavior(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
 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.
protected  Exit buildExit(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  Race buildGenRace(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.util.List<Item> buildItem(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  MOB buildMob(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
 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
protected  boolean checkMetacraftItem(Item I, Triad<java.lang.Integer,java.lang.Integer,java.lang.Class<?>[]> filter)
           
protected  void checkRequirements(java.util.Map<java.lang.String,java.lang.Object> defined, java.lang.String requirements)
           
 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.
protected  boolean checkRequirementsValue(java.lang.String validValue, java.lang.String value)
           
protected  java.lang.String cleanRequirementsValue(java.lang.String values, java.lang.String value)
           
protected  void clearNewlyDefined(java.util.Map<java.lang.String,java.lang.Object> defined, java.util.Set<java.lang.String> exceptSet, java.lang.String prefix)
           
protected  java.util.List<ItemCraftor.ItemKeyPair> craftAllOfThisRecipe(ItemCraftor skill, int material, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  void defineReward(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String defineString, XMLLibrary.XMLTag piece, java.lang.String value, java.util.Map<java.lang.String,java.lang.Object> defined, boolean recurseAllowed)
           
protected  void defineReward(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, XMLLibrary.XMLTag piece, java.lang.String value, java.util.Map<java.lang.String,java.lang.Object> defined)
           
 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.
protected  boolean fillOutCopyCodes(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  void fillOutCopyStats(Modifiable E, Modifiable E2)
           
protected  void fillOutRequiredStatCodeSafe(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String tagName, java.lang.String statName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.lang.String fillOutStatCode(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String stat, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, boolean debug)
           
protected  void fillOutStatCodes(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.util.List<Ability> findAbilities(Modifiable E, java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
           
protected  java.util.List<Ability> findAbilities(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
           
protected  java.util.List<Ability> findAffects(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
           
 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
protected  java.util.List<Behavior> findBehaviors(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.util.List<Item> findContents(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  Exit findExit(Modifiable M, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.util.List<Exit> findExits(Modifiable M, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
           
protected  java.util.List<Item> findItems(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
           
 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.
protected  java.util.List<MOB> findMobs(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
           
 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.
protected  java.lang.String findOptionalString(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, boolean debug)
           
protected  java.lang.String findOptionalStringNow(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, boolean debug)
           
protected  java.util.List<AbilityMapper.AbilityMapping> findRaceAbles(Modifiable E, java.lang.String tagName, java.lang.String prefix, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.util.List<Race> findRaces(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  Room findRoom(Area A, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, Exit[] exits, int directions)
           
protected  PairVector<Room,Exit[]> findRooms(XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, Exit[] exits, int direction)
           
protected  java.util.List<Triad<Environmental,java.lang.Integer,java.lang.Long>> findShopInventory(Modifiable E, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.lang.String findString(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
 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.
protected  java.lang.String findStringNow(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.lang.String findStringNow(java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.util.List<XMLLibrary.XMLTag> getAllChoices(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, boolean skipTest)
           
 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.
protected  java.lang.String getMetacraftFilter(java.lang.String recipe, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined, Triad<java.lang.Integer,java.lang.Integer,java.lang.Class<?>[]> filter)
           
protected  java.util.Set<java.lang.String> getPrevouslyDefined(java.util.Map<java.lang.String,java.lang.Object> defined, java.lang.String prefix)
           
protected  java.util.List<Item> getRaceItems(Modifiable E, java.lang.String tagName, java.lang.String prefix, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.lang.String getRequirementsDescription(java.lang.String values)
           
 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.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
protected  void layoutFollow(AreaGenerationLibrary.LayoutNode n, AreaGenerationLibrary.LayoutTypes type, int direction, java.util.HashSet<AreaGenerationLibrary.LayoutNode> nodesAlreadyGrouped, java.util.List<AreaGenerationLibrary.LayoutNode> group)
           
protected  void layoutRecursiveFill(AreaGenerationLibrary.LayoutNode n, java.util.HashSet<AreaGenerationLibrary.LayoutNode> nodesDone, java.util.Vector<AreaGenerationLibrary.LayoutNode> group, AreaGenerationLibrary.LayoutTypes type)
           
protected  Room layOutRooms(Area A, AreaGenerationLibrary.LayoutManager layoutManager, int size, int direction, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  int makeNewLevel(int level, int oldMin, int oldMax, int newMin, int newMax)
           
protected  java.util.List<com.planet_ink.coffee_mud.Libraries.MUDPercolator.Varidentifier> parseVariables(java.lang.String str)
           
 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.
protected  java.lang.String PostProcessAttempter(java.util.Map<java.lang.String,java.lang.Object> defined, MUDPercolator.PostProcessAttempt attempter)
           
protected  void preDefineReward(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
 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.
protected  XMLLibrary.XMLTag processLikeParm(java.lang.String tagName, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  Room processRoom(Area A, int direction, XMLLibrary.XMLTag piece, AreaGenerationLibrary.LayoutNode node, java.util.Map<java.lang.String,java.lang.Object> groupDefined)
           
 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.
protected  java.util.List<XMLLibrary.XMLTag> selectChoices(Modifiable E, java.lang.String tagName, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.util.List<XMLLibrary.XMLTag> choices, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
 boolean shutdown()
          Shuts down the library.
protected  java.lang.String strFilter(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String str, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  java.lang.String strFilterNow(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String str, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  boolean testCondition(Modifiable E, java.util.List<java.lang.String> ignoreStats, java.lang.String defPrefix, java.lang.String condition, XMLLibrary.XMLTag piece, java.util.Map<java.lang.String,java.lang.Object> defined)
           
protected  void updateLayoutDefinitions(java.util.Map<java.lang.String,java.lang.Object> defined, java.util.Map<java.lang.String,java.lang.Object> groupDefined, java.util.Map<java.util.List<AreaGenerationLibrary.LayoutNode>,java.util.Map<java.lang.String,java.lang.Object>> groupDefinitions, java.util.List<java.util.List<AreaGenerationLibrary.LayoutNode>> roomGroups)
           
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, tick
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
getServiceClient, L, propertiesLoaded
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

splitters

protected static final char[] splitters

emptyMetacraftFilter

protected static final Triad<java.lang.Integer,java.lang.Integer,java.lang.Class<?>[]> emptyMetacraftFilter

POST_PROCESSING_STAT_SETS

protected static final java.lang.String POST_PROCESSING_STAT_SETS
See Also:
Constant Field Values

UPPER_REQUIRES_KEYWORDS

protected static final java.util.Set<java.lang.String> UPPER_REQUIRES_KEYWORDS

REQUIRES_DELIMITERS

protected static final CMParms.DelimiterChecker REQUIRES_DELIMITERS
Constructor Detail

MUDPercolator

public MUDPercolator()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdLibrary
Returns:
the name of this class

getLayoutManager

public AreaGenerationLibrary.LayoutManager getLayoutManager(java.lang.String named)
Description copied from interface: AreaGenerationLibrary
Returns the layout manager of the given name.

Specified by:
getLayoutManager in interface AreaGenerationLibrary
Parameters:
named - the name of the layout manager
Returns:
the layout manager of the given name.

buildDefinedIDSet

public void buildDefinedIDSet(java.util.List<XMLLibrary.XMLTag> xmlRoot,
                              java.util.Map<java.lang.String,java.lang.Object> defined)
Description copied from interface: AreaGenerationLibrary
Given an area-generation xml file, this method will return all the defined tag ids. This allows the caller to specifically select one of them for generation.

Specified by:
buildDefinedIDSet in interface AreaGenerationLibrary
Parameters:
xmlRoot - the root of the area-generation xml file
defined - a map of ids to objects, whether strings or tags.

activate

public boolean activate()
Description copied from interface: CMLibrary
Activates the library. This is called after the mud is booted, but before connections are accepted.

Specified by:
activate in interface CMLibrary
Overrides:
activate in class StdLibrary
Returns:
true if activation was successful, false if you're screwed
See Also:
CMLibrary.shutdown()

shutdown

public boolean shutdown()
Description copied from interface: CMLibrary
Shuts down the library. Called at system shutdown time obviously, but is sometimes called just to reset the library.

Specified by:
shutdown in interface CMLibrary
Overrides:
shutdown in class StdLibrary
Returns:
true if shutdown was successful, false if there's nothing you can do about it
See Also:
CMLibrary.activate()

PostProcessAttempter

protected final java.lang.String PostProcessAttempter(java.util.Map<java.lang.String,java.lang.Object> defined,
                                                      MUDPercolator.PostProcessAttempt attempter)
                                               throws CMException
Throws:
CMException

fillOutRequiredStatCodeSafe

protected void fillOutRequiredStatCodeSafe(Modifiable E,
                                           java.util.List<java.lang.String> ignoreStats,
                                           java.lang.String defPrefix,
                                           java.lang.String tagName,
                                           java.lang.String statName,
                                           XMLLibrary.XMLTag piece,
                                           java.util.Map<java.lang.String,java.lang.Object> defined)
                                    throws CMException
Throws:
CMException

buildRoom

public Room buildRoom(XMLLibrary.XMLTag piece,
                      java.util.Map<java.lang.String,java.lang.Object> defined,
                      Exit[] exits,
                      int direction)
               throws CMException
Description copied from interface: AreaGenerationLibrary
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

Specified by:
buildRoom in interface AreaGenerationLibrary
Parameters:
piece - the identified tag that can return a room
defined - the defined id set from the entire xml document
exits - pre-defined exits from this room, if any
direction - the direction of entrance to this room
Returns:
the room generated from the tag.
Throws:
CMException - any parsing or generation errors
See Also:
AreaGenerationLibrary.buildDefinedIDSet(List, Map)

postProcess

public void postProcess(java.util.Map<java.lang.String,java.lang.Object> defined)
                 throws CMException
Description copied from interface: AreaGenerationLibrary
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. In those cases, this method is called with the defined id list as it was returned during primary area, room, item, mob, or string generation. The post-processes will be extracted from the defined ids, and then processed on those objects.

Specified by:
postProcess in interface AreaGenerationLibrary
Parameters:
defined - the defined ids after they've gone through generating an object
Throws:
CMException - any parsing or generation errors

layoutRecursiveFill

protected void layoutRecursiveFill(AreaGenerationLibrary.LayoutNode n,
                                   java.util.HashSet<AreaGenerationLibrary.LayoutNode> nodesDone,
                                   java.util.Vector<AreaGenerationLibrary.LayoutNode> group,
                                   AreaGenerationLibrary.LayoutTypes type)

layoutFollow

protected void layoutFollow(AreaGenerationLibrary.LayoutNode n,
                            AreaGenerationLibrary.LayoutTypes type,
                            int direction,
                            java.util.HashSet<AreaGenerationLibrary.LayoutNode> nodesAlreadyGrouped,
                            java.util.List<AreaGenerationLibrary.LayoutNode> group)

findArea

public Area findArea(XMLLibrary.XMLTag piece,
                     java.util.Map<java.lang.String,java.lang.Object> defined,
                     int directions)
              throws CMException
Description copied from interface: AreaGenerationLibrary
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

Specified by:
findArea in interface AreaGenerationLibrary
Parameters:
piece - the identified tag that can return a room
defined - the defined id set from the entire xml document
directions - the direction of entrance to this room
Returns:
the area generated from the tag.
Throws:
CMException - any parsing or generation errors
See Also:
AreaGenerationLibrary.buildDefinedIDSet(List, Map)

buildArea

protected Area buildArea(XMLLibrary.XMLTag piece,
                         java.util.Map<java.lang.String,java.lang.Object> defined,
                         int direction)
                  throws CMException
Throws:
CMException

updateLayoutDefinitions

protected void updateLayoutDefinitions(java.util.Map<java.lang.String,java.lang.Object> defined,
                                       java.util.Map<java.lang.String,java.lang.Object> groupDefined,
                                       java.util.Map<java.util.List<AreaGenerationLibrary.LayoutNode>,java.util.Map<java.lang.String,java.lang.Object>> groupDefinitions,
                                       java.util.List<java.util.List<AreaGenerationLibrary.LayoutNode>> roomGroups)

layOutRooms

protected Room layOutRooms(Area A,
                           AreaGenerationLibrary.LayoutManager layoutManager,
                           int size,
                           int direction,
                           XMLLibrary.XMLTag piece,
                           java.util.Map<java.lang.String,java.lang.Object> defined)
                    throws CMException
Throws:
CMException

fillInArea

public boolean fillInArea(XMLLibrary.XMLTag piece,
                          java.util.Map<java.lang.String,java.lang.Object> defined,
                          Area A,
                          int direction)
                   throws CMException
Description copied from interface: AreaGenerationLibrary
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.

Specified by:
fillInArea in interface AreaGenerationLibrary
Parameters:
piece - the identified tag that can return a room
defined - the defined id set from the entire xml document
A - the area to put the rooms into
direction - the direction of entrance to this room
Returns:
true if everything went well, an exception otherwise
Throws:
CMException - any parsing or generation errors
See Also:
AreaGenerationLibrary.buildDefinedIDSet(List, Map)

processRoom

protected Room processRoom(Area A,
                           int direction,
                           XMLLibrary.XMLTag piece,
                           AreaGenerationLibrary.LayoutNode node,
                           java.util.Map<java.lang.String,java.lang.Object> groupDefined)
                    throws CMException
Throws:
CMException

findMobs

public java.util.List<MOB> findMobs(XMLLibrary.XMLTag piece,
                                    java.util.Map<java.lang.String,java.lang.Object> defined)
                             throws CMException
Description copied from interface: AreaGenerationLibrary
Given a specific MOB generation tag, this method will return the MOBs selected by that tag piece.

Specified by:
findMobs in interface AreaGenerationLibrary
Parameters:
piece - the identified tag that can return MOBs
defined - the defined id set from the entire xml document
Returns:
the list of MOBs generated from the tag.
Throws:
CMException - any parsing or generation errors
See Also:
AreaGenerationLibrary.buildDefinedIDSet(List, Map)

findMobs

protected java.util.List<MOB> findMobs(Modifiable E,
                                       XMLLibrary.XMLTag piece,
                                       java.util.Map<java.lang.String,java.lang.Object> defined,
                                       com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
                                throws CMException
Throws:
CMException

findRoom

protected Room findRoom(Area A,
                        XMLLibrary.XMLTag piece,
                        java.util.Map<java.lang.String,java.lang.Object> defined,
                        Exit[] exits,
                        int directions)
                 throws CMException
Throws:
CMException

findRooms

protected PairVector<Room,Exit[]> findRooms(XMLLibrary.XMLTag piece,
                                            java.util.Map<java.lang.String,java.lang.Object> defined,
                                            Exit[] exits,
                                            int direction)
                                     throws CMException
Throws:
CMException

findExit

protected Exit findExit(Modifiable M,
                        XMLLibrary.XMLTag piece,
                        java.util.Map<java.lang.String,java.lang.Object> defined)
                 throws CMException
Throws:
CMException

parseVariables

protected java.util.List<com.planet_ink.coffee_mud.Libraries.MUDPercolator.Varidentifier> parseVariables(java.lang.String str)

fillOutStatCode

protected java.lang.String fillOutStatCode(Modifiable E,
                                           java.util.List<java.lang.String> ignoreStats,
                                           java.lang.String defPrefix,
                                           java.lang.String stat,
                                           XMLLibrary.XMLTag piece,
                                           java.util.Map<java.lang.String,java.lang.Object> defined,
                                           boolean debug)

fillOutStatCodes

protected void fillOutStatCodes(Modifiable E,
                                java.util.List<java.lang.String> ignoreStats,
                                java.lang.String defPrefix,
                                XMLLibrary.XMLTag piece,
                                java.util.Map<java.lang.String,java.lang.Object> defined)

fillOutCopyStats

protected void fillOutCopyStats(Modifiable E,
                                Modifiable E2)

fillOutCopyCodes

protected boolean fillOutCopyCodes(Modifiable E,
                                   java.util.List<java.lang.String> ignoreStats,
                                   java.lang.String defPrefix,
                                   XMLLibrary.XMLTag piece,
                                   java.util.Map<java.lang.String,java.lang.Object> defined)
                            throws CMException
Throws:
CMException

buildMob

protected MOB buildMob(XMLLibrary.XMLTag piece,
                       java.util.Map<java.lang.String,java.lang.Object> defined)
                throws CMException
Throws:
CMException

findExits

protected java.util.List<Exit> findExits(Modifiable M,
                                         XMLLibrary.XMLTag piece,
                                         java.util.Map<java.lang.String,java.lang.Object> defined,
                                         com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
                                  throws CMException
Throws:
CMException

buildExit

protected Exit buildExit(XMLLibrary.XMLTag piece,
                         java.util.Map<java.lang.String,java.lang.Object> defined)
                  throws CMException
Throws:
CMException

findShopInventory

protected java.util.List<Triad<Environmental,java.lang.Integer,java.lang.Long>> findShopInventory(Modifiable E,
                                                                                                  XMLLibrary.XMLTag piece,
                                                                                                  java.util.Map<java.lang.String,java.lang.Object> defined)
                                                                                           throws CMException
Throws:
CMException

getPrevouslyDefined

protected java.util.Set<java.lang.String> getPrevouslyDefined(java.util.Map<java.lang.String,java.lang.Object> defined,
                                                              java.lang.String prefix)

clearNewlyDefined

protected void clearNewlyDefined(java.util.Map<java.lang.String,java.lang.Object> defined,
                                 java.util.Set<java.lang.String> exceptSet,
                                 java.lang.String prefix)

findItems

public java.util.List<Item> findItems(XMLLibrary.XMLTag piece,
                                      java.util.Map<java.lang.String,java.lang.Object> defined)
                               throws CMException
Description copied from interface: AreaGenerationLibrary
Given a specific ITEM generation tag, this method will return the items selected by that tag piece.

Specified by:
findItems in interface AreaGenerationLibrary
Parameters:
piece - the identified tag that can return items
defined - the defined id set from the entire xml document
Returns:
the list of items generated from the tag.
Throws:
CMException - any parsing or generation errors
See Also:
AreaGenerationLibrary.buildDefinedIDSet(List, Map)

findItems

protected java.util.List<Item> findItems(Modifiable E,
                                         XMLLibrary.XMLTag piece,
                                         java.util.Map<java.lang.String,java.lang.Object> defined,
                                         com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
                                  throws CMException
Throws:
CMException

findContents

protected java.util.List<Item> findContents(XMLLibrary.XMLTag piece,
                                            java.util.Map<java.lang.String,java.lang.Object> defined)
                                     throws CMException
Throws:
CMException

getMetacraftFilter

protected java.lang.String getMetacraftFilter(java.lang.String recipe,
                                              XMLLibrary.XMLTag piece,
                                              java.util.Map<java.lang.String,java.lang.Object> defined,
                                              Triad<java.lang.Integer,java.lang.Integer,java.lang.Class<?>[]> filter)
                                       throws CMException
Throws:
CMException

craftAllOfThisRecipe

protected java.util.List<ItemCraftor.ItemKeyPair> craftAllOfThisRecipe(ItemCraftor skill,
                                                                       int material,
                                                                       java.util.Map<java.lang.String,java.lang.Object> defined)

checkMetacraftItem

protected boolean checkMetacraftItem(Item I,
                                     Triad<java.lang.Integer,java.lang.Integer,java.lang.Class<?>[]> filter)

buildItem

protected java.util.List<Item> buildItem(XMLLibrary.XMLTag piece,
                                         java.util.Map<java.lang.String,java.lang.Object> defined)
                                  throws CMException
Throws:
CMException

findAffects

protected java.util.List<Ability> findAffects(Modifiable E,
                                              XMLLibrary.XMLTag piece,
                                              java.util.Map<java.lang.String,java.lang.Object> defined,
                                              com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
                                       throws CMException
Throws:
CMException

findAbilities

protected java.util.List<Ability> findAbilities(Modifiable E,
                                                XMLLibrary.XMLTag piece,
                                                java.util.Map<java.lang.String,java.lang.Object> defined,
                                                com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
                                         throws CMException
Throws:
CMException

findAbilities

protected java.util.List<Ability> findAbilities(Modifiable E,
                                                java.lang.String tagName,
                                                XMLLibrary.XMLTag piece,
                                                java.util.Map<java.lang.String,java.lang.Object> defined,
                                                com.planet_ink.coffee_mud.Libraries.MUDPercolator.BuildCallback callBack)
                                         throws CMException
Throws:
CMException

findBehaviors

protected java.util.List<Behavior> findBehaviors(Modifiable E,
                                                 XMLLibrary.XMLTag piece,
                                                 java.util.Map<java.lang.String,java.lang.Object> defined)
                                          throws CMException
Throws:
CMException

findRaces

protected java.util.List<Race> findRaces(Modifiable E,
                                         XMLLibrary.XMLTag piece,
                                         java.util.Map<java.lang.String,java.lang.Object> defined)
                                  throws CMException,
                                         com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
CMException
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

buildAbility

protected Ability buildAbility(Modifiable E,
                               XMLLibrary.XMLTag piece,
                               java.util.Map<java.lang.String,java.lang.Object> defined)
                        throws CMException
Throws:
CMException

buildBehavior

protected Behavior buildBehavior(Modifiable E,
                                 XMLLibrary.XMLTag piece,
                                 java.util.Map<java.lang.String,java.lang.Object> defined)
                          throws CMException
Throws:
CMException

findRaceAbles

protected java.util.List<AbilityMapper.AbilityMapping> findRaceAbles(Modifiable E,
                                                                     java.lang.String tagName,
                                                                     java.lang.String prefix,
                                                                     XMLLibrary.XMLTag piece,
                                                                     java.util.Map<java.lang.String,java.lang.Object> defined)
                                                              throws CMException
Throws:
CMException

getRaceItems

protected java.util.List<Item> getRaceItems(Modifiable E,
                                            java.lang.String tagName,
                                            java.lang.String prefix,
                                            XMLLibrary.XMLTag piece,
                                            java.util.Map<java.lang.String,java.lang.Object> defined)
                                     throws CMException
Throws:
CMException

buildGenRace

protected Race buildGenRace(Modifiable E,
                            XMLLibrary.XMLTag piece,
                            java.util.Map<java.lang.String,java.lang.Object> defined)
                     throws CMException
Throws:
CMException

addDefinition

protected void addDefinition(java.lang.String definition,
                             java.lang.String value,
                             java.util.Map<java.lang.String,java.lang.Object> defined)

findOptionalStringNow

protected java.lang.String findOptionalStringNow(Modifiable E,
                                                 java.util.List<java.lang.String> ignoreStats,
                                                 java.lang.String defPrefix,
                                                 java.lang.String tagName,
                                                 XMLLibrary.XMLTag piece,
                                                 java.util.Map<java.lang.String,java.lang.Object> defined,
                                                 boolean debug)

findOptionalString

protected java.lang.String findOptionalString(Modifiable E,
                                              java.util.List<java.lang.String> ignoreStats,
                                              java.lang.String defPrefix,
                                              java.lang.String tagName,
                                              XMLLibrary.XMLTag piece,
                                              java.util.Map<java.lang.String,java.lang.Object> defined,
                                              boolean debug)
                                       throws com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

defineReward

public void defineReward(XMLLibrary.XMLTag piece,
                         java.util.Map<java.lang.String,java.lang.Object> defined)
                  throws CMException
Description copied from interface: AreaGenerationLibrary
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. In those cases, before generation of the object from the selected xml tag piece, this method is called to handle post-selection processing (called rewarding, as in a reward for being picked).

Specified by:
defineReward in interface AreaGenerationLibrary
Parameters:
piece - the selected xml tag piece
defined - the defined id set from the entire xml document
Throws:
CMException - any parsing or generation errors

defineReward

protected void defineReward(Modifiable E,
                            java.util.List<java.lang.String> ignoreStats,
                            java.lang.String defPrefix,
                            XMLLibrary.XMLTag piece,
                            java.lang.String value,
                            java.util.Map<java.lang.String,java.lang.Object> defined)
                     throws CMException
Throws:
CMException

preDefineReward

public void preDefineReward(XMLLibrary.XMLTag piece,
                            java.util.Map<java.lang.String,java.lang.Object> defined)
                     throws CMException
Description copied from interface: AreaGenerationLibrary
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. In those cases, before generation of the object from the selected xml tag piece, this method is called to handle pre-selection processing (called rewarding, as in a reward for being picked).

Specified by:
preDefineReward in interface AreaGenerationLibrary
Parameters:
piece - the selected xml tag piece
defined - the defined id set from the entire xml document
Throws:
CMException - any parsing or generation errors

preDefineReward

protected void preDefineReward(Modifiable E,
                               java.util.List<java.lang.String> ignoreStats,
                               java.lang.String defPrefix,
                               XMLLibrary.XMLTag piece,
                               java.util.Map<java.lang.String,java.lang.Object> defined)
                        throws CMException
Throws:
CMException

defineReward

protected void defineReward(Modifiable E,
                            java.util.List<java.lang.String> ignoreStats,
                            java.lang.String defPrefix,
                            java.lang.String defineString,
                            XMLLibrary.XMLTag piece,
                            java.lang.String value,
                            java.util.Map<java.lang.String,java.lang.Object> defined,
                            boolean recurseAllowed)
                     throws CMException,
                            com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
CMException
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

findStringNow

protected java.lang.String findStringNow(Modifiable E,
                                         java.util.List<java.lang.String> ignoreStats,
                                         java.lang.String defPrefix,
                                         java.lang.String tagName,
                                         XMLLibrary.XMLTag piece,
                                         java.util.Map<java.lang.String,java.lang.Object> defined)
                                  throws CMException
Throws:
CMException

findString

protected java.lang.String findString(Modifiable E,
                                      java.util.List<java.lang.String> ignoreStats,
                                      java.lang.String defPrefix,
                                      java.lang.String tagName,
                                      XMLLibrary.XMLTag piece,
                                      java.util.Map<java.lang.String,java.lang.Object> defined)
                               throws CMException,
                                      com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
CMException
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

processLikeParm

protected XMLLibrary.XMLTag processLikeParm(java.lang.String tagName,
                                            XMLLibrary.XMLTag piece,
                                            java.util.Map<java.lang.String,java.lang.Object> defined)
                                     throws CMException
Throws:
CMException

getAllChoices

public java.util.List<XMLLibrary.XMLTag> getAllChoices(java.lang.String tagName,
                                                       XMLLibrary.XMLTag piece,
                                                       java.util.Map<java.lang.String,java.lang.Object> defined)
                                                throws CMException
Description copied from interface: AreaGenerationLibrary
Given a root xml tag and a tag name, this method will return all matching xml tag pieces.

Specified by:
getAllChoices in interface AreaGenerationLibrary
Parameters:
tagName - the name of the tag to search for
piece - the root xml tag piece
defined - the defined id set from the entire xml document
Returns:
the list of found xml tags that match the tag name
Throws:
CMException - any parsing or generation errors

getAllChoices

protected java.util.List<XMLLibrary.XMLTag> getAllChoices(Modifiable E,
                                                          java.util.List<java.lang.String> ignoreStats,
                                                          java.lang.String defPrefix,
                                                          java.lang.String tagName,
                                                          XMLLibrary.XMLTag piece,
                                                          java.util.Map<java.lang.String,java.lang.Object> defined,
                                                          boolean skipTest)
                                                   throws CMException,
                                                          com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
CMException
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

testCondition

protected boolean testCondition(Modifiable E,
                                java.util.List<java.lang.String> ignoreStats,
                                java.lang.String defPrefix,
                                java.lang.String condition,
                                XMLLibrary.XMLTag piece,
                                java.util.Map<java.lang.String,java.lang.Object> defined)
                         throws com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

getRequirementsDescription

protected java.lang.String getRequirementsDescription(java.lang.String values)

checkRequirementsValue

protected boolean checkRequirementsValue(java.lang.String validValue,
                                         java.lang.String value)

cleanRequirementsValue

protected java.lang.String cleanRequirementsValue(java.lang.String values,
                                                  java.lang.String value)

getUnfilledRequirements

public java.util.Map<java.lang.String,java.lang.String> getUnfilledRequirements(java.util.Map<java.lang.String,java.lang.Object> defined,
                                                                                XMLLibrary.XMLTag piece)
Description copied from interface: AreaGenerationLibrary
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. If not, it returns a map of the undefined or mis-defined ids as keys, mapped to the data type name.

Specified by:
getUnfilledRequirements in interface AreaGenerationLibrary
Parameters:
defined - the defined id set from the entire xml document, and the user
piece - the xml tag piece you want to build
Returns:
a map of the undefined or mis-defined ids as keys, mapped to the data type name

checkRequirements

protected void checkRequirements(java.util.Map<java.lang.String,java.lang.Object> defined,
                                 java.lang.String requirements)
                          throws CMException
Throws:
CMException

checkRequirements

public void checkRequirements(XMLLibrary.XMLTag piece,
                              java.util.Map<java.lang.String,java.lang.Object> defined)
                       throws CMException
Description copied from interface: AreaGenerationLibrary
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. If not, it throws an exception.

Specified by:
checkRequirements in interface AreaGenerationLibrary
Parameters:
piece - the xml tag piece you want to build
defined - the defined id set from the entire xml document, and the user
Throws:
CMException - any parsing or generation errors

selectChoices

protected java.util.List<XMLLibrary.XMLTag> selectChoices(Modifiable E,
                                                          java.lang.String tagName,
                                                          java.util.List<java.lang.String> ignoreStats,
                                                          java.lang.String defPrefix,
                                                          java.util.List<XMLLibrary.XMLTag> choices,
                                                          XMLLibrary.XMLTag piece,
                                                          java.util.Map<java.lang.String,java.lang.Object> defined)
                                                   throws CMException,
                                                          com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
CMException
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

strFilterNow

protected java.lang.String strFilterNow(Modifiable E,
                                        java.util.List<java.lang.String> ignoreStats,
                                        java.lang.String defPrefix,
                                        java.lang.String str,
                                        XMLLibrary.XMLTag piece,
                                        java.util.Map<java.lang.String,java.lang.Object> defined)
                                 throws CMException
Throws:
CMException

strFilter

protected java.lang.String strFilter(Modifiable E,
                                     java.util.List<java.lang.String> ignoreStats,
                                     java.lang.String defPrefix,
                                     java.lang.String str,
                                     XMLLibrary.XMLTag piece,
                                     java.util.Map<java.lang.String,java.lang.Object> defined)
                              throws CMException,
                                     com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException
Throws:
CMException
com.planet_ink.coffee_mud.Libraries.MUDPercolator.PostProcessException

findString

public java.lang.String findString(java.lang.String tagName,
                                   XMLLibrary.XMLTag piece,
                                   java.util.Map<java.lang.String,java.lang.Object> defined)
                            throws CMException
Description copied from interface: AreaGenerationLibrary
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.

Specified by:
findString in interface AreaGenerationLibrary
Parameters:
tagName - the name of the string tag
piece - the top level piece, probably of type tagname
defined - the pre-defined id set from the entire xml document
Returns:
the string this resolves to
Throws:
CMException - any parsing or generation errors
See Also:
AreaGenerationLibrary.buildDefinedIDSet(List, Map)

findStringNow

protected java.lang.String findStringNow(java.lang.String tagName,
                                         XMLLibrary.XMLTag piece,
                                         java.util.Map<java.lang.String,java.lang.Object> defined)
                                  throws CMException
Throws:
CMException

makeNewLevel

protected int makeNewLevel(int level,
                           int oldMin,
                           int oldMax,
                           int newMin,
                           int newMax)

relevelRoom

public boolean relevelRoom(Room room,
                           int oldMin,
                           int oldMax,
                           int newMin,
                           int newMax)
Description copied from interface: AreaGenerationLibrary
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.

Specified by:
relevelRoom in interface AreaGenerationLibrary
Parameters:
room - the room to adjust
oldMin - current minimum level range for the rooms area
oldMax - current maximum level range for the rooms area
newMin - new minimum level range for the rooms area
newMax - new maximum level range for the rooms area
Returns:
true if the room was modified, false otherwise.