com.planet_ink.coffee_mud.Libraries
Class MUDTracker

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

public class MUDTracker
extends StdLibrary
implements TrackingLibrary


Nested Class Summary
protected static class MUDTracker.DefaultRFilters
           
protected static class MUDTracker.DefaultTrackingFlags
           
protected static class MUDTracker.RFilterNode
           
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.TrackingLibrary
TrackingLibrary.RFilter, TrackingLibrary.RFilters, TrackingLibrary.TrackingFlag, TrackingLibrary.TrackingFlags
 
Field Summary
protected  java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> closeCommandSets
           
protected  java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> directionCommandSets
           
protected static TrackingLibrary.RFilters EMPTY_FILTERS
           
protected static TrackingLibrary.TrackingFlags EMPTY_FLAGS
           
protected  java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> openCommandSets
           
protected  java.util.Map<TrackingLibrary.TrackingFlags,TrackingLibrary.RFilters> trackingFilters
           
 
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
MUDTracker()
           
 
Method Summary
static java.util.List<Rider> addRiders(Rider theRider, Rideable riding, java.util.List<Rider> riders)
           
 boolean autoTrack(MOB mob, Room destR)
           
 boolean beMobile(MOB mob, boolean dooropen, boolean wander, boolean roomprefer, boolean roomobject, int[] status, java.util.Set<Room> rooms)
           
 PairVector<Room,int[]> buildGridList(Room room, java.lang.String ownerName, int maxDepth)
           
 boolean canValidTrail(Room R1, java.util.List<Room> set, java.lang.String where, int radius, java.util.Set<Room> ignoreRooms, int maxMins)
           
 Rideable findALadder(MOB mob, Room room)
           
 java.util.List<java.util.List<java.lang.Integer>> findAllTrails(Room from, java.util.List<Room> tos, java.util.List<Room> radiantTrail)
           
 java.util.List<java.util.List<java.lang.Integer>> findAllTrails(Room from, Room to, java.util.List<Room> radiantTrail)
           
 int findExitDir(MOB mob, Room R, java.lang.String desc)
           
 int findRoomDir(MOB mob, Room R)
           
 java.util.List<Room> findTrailToAnyRoom(Room location, java.util.List<Room> destRooms, TrackingLibrary.TrackingFlags flags, int maxRadius)
           
 java.util.List<Room> findTrailToAnyRoom(Room location, TrackingLibrary.RFilter destFilter, TrackingLibrary.TrackingFlags flags, int maxRadius)
           
 java.util.List<Room> findTrailToRoom(Room location, Room destRoom, TrackingLibrary.TrackingFlags flags, int maxRadius)
           
 java.util.List<Room> findTrailToRoom(Room location, Room destRoom, TrackingLibrary.TrackingFlags flags, int maxRadius, java.util.List<Room> radiant)
           
 void forceEntry(MOB M, Room toHere, boolean andFollowers, boolean forceLook, java.lang.String msg)
           
 void forceRecall(MOB mob, boolean includeFollowers)
           
 Room getCalculatedAdjacentRoom(PairVector<Room,int[]> rooms, Room R, int dir)
           
protected  int getCheckedDir(MOB M, Room toHere)
           
protected  java.util.List<java.lang.String> getCloseCommandSet(int direction)
           
protected  java.util.List<java.lang.String> getDirectionCommandSet(int direction)
           
protected  int getIndexEnsureSet(Room R1, Room R2, java.util.List<Room> set, int radius, java.util.Set<Room> ignoreRooms)
           
protected  java.util.List<java.lang.String> getOpenCommandSet(int direction)
           
 void getRadiantRooms(Room room, java.util.List<Room> rooms, TrackingLibrary.RFilters filters, Room radiateTo, int maxDepth, java.util.Set<Room> ignoreRooms)
           
 void getRadiantRooms(Room room, java.util.List<Room> rooms, TrackingLibrary.TrackingFlags flags, Room radiateTo, int maxDepth, java.util.Set<Room> ignoreRooms)
           
 java.util.List<Room> getRadiantRooms(Room room, TrackingLibrary.RFilters filters, int maxDepth)
           
 java.util.List<Room> getRadiantRooms(Room room, TrackingLibrary.TrackingFlags flags, int maxDepth)
           
protected  boolean getRadiantRoomsToTarget(Room room, java.util.List<Room> rooms, TrackingLibrary.RFilters filters, TrackingLibrary.RFilter radiateTo, int maxDepth)
           
protected  boolean getRadiantRoomsToTarget(Room room, java.util.List<Room> rooms, TrackingLibrary.TrackingFlags flags, TrackingLibrary.RFilter radiateTo, int maxDepth)
           
 Room getRadiantRoomTarget(Room room, TrackingLibrary.RFilters filters, TrackingLibrary.RFilter radiateTo)
           
protected  int getRoomDirection(Room R, Room toRoom, java.util.List<Room> ignore)
           
 java.util.List<java.lang.Integer> getShortestTrail(java.util.List<java.util.List<java.lang.Integer>> finalSets)
           
 java.lang.String getTrailToDescription(Room R1, java.util.List<Room> set, java.lang.String where, boolean areaNames, boolean confirm, int radius, java.util.Set<Room> ignoreRooms, int maxMins)
           
protected  Room getWhere(java.lang.String where, java.util.List<Room> set)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isAnAdminHere(Room R, boolean sysMsgsOnly)
           
 CMMsg.CheckedMsgResponse isOkWaterSurfaceAffect(Room room, CMMsg msg)
           
 boolean makeFall(Physical P, Room room, boolean reverseFall)
           
 void makeSink(Physical P, Room room, boolean reverseSink)
           
 void markToWanderHomeLater(MOB M)
           
protected  boolean move(MOB mob, int directionCode, boolean flee, boolean nolook, boolean noriders, boolean always, boolean running)
           
 TrackingLibrary.TrackingFlags newFlags()
           
 void postMountLadder(MOB mob, Rideable ladder)
           
 int radiatesFromDir(Room room, java.util.List<Room> rooms)
           
 java.util.List<Rider> ridersAhead(Rider theRider, Room sourceRoom, Room destRoom, int directionCode, boolean flee, boolean running)
           
 void ridersBehind(java.util.List<Rider> riders, Room sourceRoom, Room destRoom, int directionCode, boolean flee, boolean running)
           
 boolean run(MOB mob, int directionCode, boolean flee, boolean nolook, boolean noriders)
           
 boolean run(MOB mob, int directionCode, boolean flee, boolean nolook, boolean noriders, boolean always)
           
 void stopTracking(MOB mob)
           
 int trackNextDirectionFromHere(java.util.List<Room> theTrail, Room location, boolean openOnly)
           
 boolean walk(Item I, int directionCode)
           
 boolean walk(MOB mob, int directionCode, boolean flee, boolean nolook)
           
 boolean walk(MOB mob, int directionCode, boolean flee, boolean nolook, boolean noriders)
           
 boolean walk(MOB mob, int directionCode, boolean flee, boolean nolook, boolean noriders, boolean always)
           
 void walkForced(MOB M, Room fromHere, Room toHere, boolean andFollowers, boolean forceLook, java.lang.String msgStr)
           
 void wanderAway(MOB M, boolean mindPCs, boolean andGoHome)
           
 boolean wanderCheckedAway(MOB M, boolean mindPCs, boolean andGoHome)
           
 boolean wanderCheckedFromTo(MOB M, Room toHere, boolean mindPCs)
           
 void wanderFromTo(MOB M, Room toHere, boolean mindPCs)
           
 void wanderIn(MOB M, Room toHere)
           
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, 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
activate, getServiceClient, L, propertiesLoaded, shutdown
 
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

directionCommandSets

protected java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> directionCommandSets

openCommandSets

protected java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> openCommandSets

closeCommandSets

protected java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> closeCommandSets

trackingFilters

protected java.util.Map<TrackingLibrary.TrackingFlags,TrackingLibrary.RFilters> trackingFilters

EMPTY_FLAGS

protected static final TrackingLibrary.TrackingFlags EMPTY_FLAGS

EMPTY_FILTERS

protected static final TrackingLibrary.RFilters EMPTY_FILTERS
Constructor Detail

MUDTracker

public MUDTracker()
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

autoTrack

public boolean autoTrack(MOB mob,
                         Room destR)
Specified by:
autoTrack in interface TrackingLibrary

getDirectionCommandSet

protected java.util.List<java.lang.String> getDirectionCommandSet(int direction)

getOpenCommandSet

protected java.util.List<java.lang.String> getOpenCommandSet(int direction)

getCloseCommandSet

protected java.util.List<java.lang.String> getCloseCommandSet(int direction)

findTrailToRoom

public java.util.List<Room> findTrailToRoom(Room location,
                                            Room destRoom,
                                            TrackingLibrary.TrackingFlags flags,
                                            int maxRadius)
Specified by:
findTrailToRoom in interface TrackingLibrary

findTrailToRoom

public java.util.List<Room> findTrailToRoom(Room location,
                                            Room destRoom,
                                            TrackingLibrary.TrackingFlags flags,
                                            int maxRadius,
                                            java.util.List<Room> radiant)
Specified by:
findTrailToRoom in interface TrackingLibrary

markToWanderHomeLater

public void markToWanderHomeLater(MOB M)
Specified by:
markToWanderHomeLater in interface TrackingLibrary

findTrailToAnyRoom

public java.util.List<Room> findTrailToAnyRoom(Room location,
                                               java.util.List<Room> destRooms,
                                               TrackingLibrary.TrackingFlags flags,
                                               int maxRadius)
Specified by:
findTrailToAnyRoom in interface TrackingLibrary

findTrailToAnyRoom

public java.util.List<Room> findTrailToAnyRoom(Room location,
                                               TrackingLibrary.RFilter destFilter,
                                               TrackingLibrary.TrackingFlags flags,
                                               int maxRadius)
Specified by:
findTrailToAnyRoom in interface TrackingLibrary

trackNextDirectionFromHere

public int trackNextDirectionFromHere(java.util.List<Room> theTrail,
                                      Room location,
                                      boolean openOnly)
Specified by:
trackNextDirectionFromHere in interface TrackingLibrary

radiatesFromDir

public int radiatesFromDir(Room room,
                           java.util.List<Room> rooms)
Specified by:
radiatesFromDir in interface TrackingLibrary

getRadiantRooms

public java.util.List<Room> getRadiantRooms(Room room,
                                            TrackingLibrary.TrackingFlags flags,
                                            int maxDepth)
Specified by:
getRadiantRooms in interface TrackingLibrary

getRadiantRooms

public java.util.List<Room> getRadiantRooms(Room room,
                                            TrackingLibrary.RFilters filters,
                                            int maxDepth)
Specified by:
getRadiantRooms in interface TrackingLibrary

getRadiantRooms

public void getRadiantRooms(Room room,
                            java.util.List<Room> rooms,
                            TrackingLibrary.TrackingFlags flags,
                            Room radiateTo,
                            int maxDepth,
                            java.util.Set<Room> ignoreRooms)
Specified by:
getRadiantRooms in interface TrackingLibrary

newFlags

public TrackingLibrary.TrackingFlags newFlags()
Specified by:
newFlags in interface TrackingLibrary

getRadiantRooms

public void getRadiantRooms(Room room,
                            java.util.List<Room> rooms,
                            TrackingLibrary.RFilters filters,
                            Room radiateTo,
                            int maxDepth,
                            java.util.Set<Room> ignoreRooms)
Specified by:
getRadiantRooms in interface TrackingLibrary

getRadiantRoomsToTarget

protected boolean getRadiantRoomsToTarget(Room room,
                                          java.util.List<Room> rooms,
                                          TrackingLibrary.TrackingFlags flags,
                                          TrackingLibrary.RFilter radiateTo,
                                          int maxDepth)

getRadiantRoomsToTarget

protected boolean getRadiantRoomsToTarget(Room room,
                                          java.util.List<Room> rooms,
                                          TrackingLibrary.RFilters filters,
                                          TrackingLibrary.RFilter radiateTo,
                                          int maxDepth)

getRadiantRoomTarget

public Room getRadiantRoomTarget(Room room,
                                 TrackingLibrary.RFilters filters,
                                 TrackingLibrary.RFilter radiateTo)
Specified by:
getRadiantRoomTarget in interface TrackingLibrary

stopTracking

public void stopTracking(MOB mob)
Specified by:
stopTracking in interface TrackingLibrary

isAnAdminHere

public boolean isAnAdminHere(Room R,
                             boolean sysMsgsOnly)
Specified by:
isAnAdminHere in interface TrackingLibrary

beMobile

public boolean beMobile(MOB mob,
                        boolean dooropen,
                        boolean wander,
                        boolean roomprefer,
                        boolean roomobject,
                        int[] status,
                        java.util.Set<Room> rooms)
Specified by:
beMobile in interface TrackingLibrary

wanderAway

public void wanderAway(MOB M,
                       boolean mindPCs,
                       boolean andGoHome)
Specified by:
wanderAway in interface TrackingLibrary

wanderCheckedAway

public boolean wanderCheckedAway(MOB M,
                                 boolean mindPCs,
                                 boolean andGoHome)
Specified by:
wanderCheckedAway in interface TrackingLibrary

wanderFromTo

public void wanderFromTo(MOB M,
                         Room toHere,
                         boolean mindPCs)
Specified by:
wanderFromTo in interface TrackingLibrary

getCheckedDir

protected int getCheckedDir(MOB M,
                            Room toHere)

wanderCheckedFromTo

public boolean wanderCheckedFromTo(MOB M,
                                   Room toHere,
                                   boolean mindPCs)
Specified by:
wanderCheckedFromTo in interface TrackingLibrary

wanderIn

public void wanderIn(MOB M,
                     Room toHere)
Specified by:
wanderIn in interface TrackingLibrary

forceEntry

public void forceEntry(MOB M,
                       Room toHere,
                       boolean andFollowers,
                       boolean forceLook,
                       java.lang.String msg)
Specified by:
forceEntry in interface TrackingLibrary

walkForced

public void walkForced(MOB M,
                       Room fromHere,
                       Room toHere,
                       boolean andFollowers,
                       boolean forceLook,
                       java.lang.String msgStr)
Specified by:
walkForced in interface TrackingLibrary

ridersBehind

public void ridersBehind(java.util.List<Rider> riders,
                         Room sourceRoom,
                         Room destRoom,
                         int directionCode,
                         boolean flee,
                         boolean running)

addRiders

public static java.util.List<Rider> addRiders(Rider theRider,
                                              Rideable riding,
                                              java.util.List<Rider> riders)

ridersAhead

public java.util.List<Rider> ridersAhead(Rider theRider,
                                         Room sourceRoom,
                                         Room destRoom,
                                         int directionCode,
                                         boolean flee,
                                         boolean running)

walk

public boolean walk(MOB mob,
                    int directionCode,
                    boolean flee,
                    boolean nolook,
                    boolean noriders)
Specified by:
walk in interface TrackingLibrary

run

public boolean run(MOB mob,
                   int directionCode,
                   boolean flee,
                   boolean nolook,
                   boolean noriders)
Specified by:
run in interface TrackingLibrary

walk

public boolean walk(MOB mob,
                    int directionCode,
                    boolean flee,
                    boolean nolook,
                    boolean noriders,
                    boolean always)
Specified by:
walk in interface TrackingLibrary

run

public boolean run(MOB mob,
                   int directionCode,
                   boolean flee,
                   boolean nolook,
                   boolean noriders,
                   boolean always)
Specified by:
run in interface TrackingLibrary

move

protected boolean move(MOB mob,
                       int directionCode,
                       boolean flee,
                       boolean nolook,
                       boolean noriders,
                       boolean always,
                       boolean running)

walk

public boolean walk(MOB mob,
                    int directionCode,
                    boolean flee,
                    boolean nolook)
Specified by:
walk in interface TrackingLibrary

walk

public boolean walk(Item I,
                    int directionCode)
Specified by:
walk in interface TrackingLibrary

findExitDir

public int findExitDir(MOB mob,
                       Room R,
                       java.lang.String desc)
Specified by:
findExitDir in interface TrackingLibrary

findRoomDir

public int findRoomDir(MOB mob,
                       Room R)
Specified by:
findRoomDir in interface TrackingLibrary

getShortestTrail

public java.util.List<java.lang.Integer> getShortestTrail(java.util.List<java.util.List<java.lang.Integer>> finalSets)
Specified by:
getShortestTrail in interface TrackingLibrary

findAllTrails

public java.util.List<java.util.List<java.lang.Integer>> findAllTrails(Room from,
                                                                       Room to,
                                                                       java.util.List<Room> radiantTrail)
Specified by:
findAllTrails in interface TrackingLibrary

findAllTrails

public java.util.List<java.util.List<java.lang.Integer>> findAllTrails(Room from,
                                                                       java.util.List<Room> tos,
                                                                       java.util.List<Room> radiantTrail)
Specified by:
findAllTrails in interface TrackingLibrary

getRoomDirection

protected int getRoomDirection(Room R,
                               Room toRoom,
                               java.util.List<Room> ignore)

getWhere

protected Room getWhere(java.lang.String where,
                        java.util.List<Room> set)

getIndexEnsureSet

protected int getIndexEnsureSet(Room R1,
                                Room R2,
                                java.util.List<Room> set,
                                int radius,
                                java.util.Set<Room> ignoreRooms)

canValidTrail

public boolean canValidTrail(Room R1,
                             java.util.List<Room> set,
                             java.lang.String where,
                             int radius,
                             java.util.Set<Room> ignoreRooms,
                             int maxMins)
Specified by:
canValidTrail in interface TrackingLibrary

getTrailToDescription

public java.lang.String getTrailToDescription(Room R1,
                                              java.util.List<Room> set,
                                              java.lang.String where,
                                              boolean areaNames,
                                              boolean confirm,
                                              int radius,
                                              java.util.Set<Room> ignoreRooms,
                                              int maxMins)
Specified by:
getTrailToDescription in interface TrackingLibrary

findALadder

public Rideable findALadder(MOB mob,
                            Room room)
Specified by:
findALadder in interface TrackingLibrary

postMountLadder

public void postMountLadder(MOB mob,
                            Rideable ladder)
Specified by:
postMountLadder in interface TrackingLibrary

makeFall

public boolean makeFall(Physical P,
                        Room room,
                        boolean reverseFall)
Specified by:
makeFall in interface TrackingLibrary

isOkWaterSurfaceAffect

public CMMsg.CheckedMsgResponse isOkWaterSurfaceAffect(Room room,
                                                       CMMsg msg)
Specified by:
isOkWaterSurfaceAffect in interface TrackingLibrary

makeSink

public void makeSink(Physical P,
                     Room room,
                     boolean reverseSink)
Specified by:
makeSink in interface TrackingLibrary

forceRecall

public void forceRecall(MOB mob,
                        boolean includeFollowers)
Specified by:
forceRecall in interface TrackingLibrary

buildGridList

public PairVector<Room,int[]> buildGridList(Room room,
                                            java.lang.String ownerName,
                                            int maxDepth)
Specified by:
buildGridList in interface TrackingLibrary

getCalculatedAdjacentRoom

public Room getCalculatedAdjacentRoom(PairVector<Room,int[]> rooms,
                                      Room R,
                                      int dir)
Specified by:
getCalculatedAdjacentRoom in interface TrackingLibrary