CMObject
, Tickable
, CMLibrary
, HelpLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class MUDHelp extends StdLibrary implements HelpLibrary
HelpLibrary.HelpSection
Modifier and Type | Field | Description |
---|---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
genUsageCost |
|
protected int[] |
proficiencyRanges |
|
protected static java.lang.String[] |
SKILL_PREFIXES |
|
protected static java.lang.String[] |
SKILL_SUFFIXES |
idConverter
isDebugging, name, serviceClient, tickStatus
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_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, 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_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
MUDHelp() |
Modifier and Type | Method | Description |
---|---|---|
void |
addHelpEntry(java.lang.String ID,
java.lang.String text,
boolean archon) |
Adds a new entry to the cached help entries.
|
boolean |
addModifyHelpEntry(MOB mob,
java.lang.String helpFile,
java.lang.String helpKey,
boolean deleteOnly) |
An asynchronous editor for help entries that also re-saves the file
when completed.
|
protected java.lang.String |
columnHelper(java.lang.String word,
java.lang.String msg,
int wrap) |
|
java.lang.String |
findHelpFile(java.lang.String key,
HelpLibrary.HelpSection searchSection,
boolean exactOnly) |
Returns the path of the help file that contains the given help key.
|
java.lang.String |
fixHelp(java.lang.String tag,
java.lang.String str,
MOB forM) |
Do post processing on the given help text, resolving tags and
other derived data that needs insertion.
|
java.lang.String |
getAbilityCostDesc(Ability A,
MOB forM) |
Returns a description of the amount of trains/practices
required by the give mob to gain the given ability.
|
java.lang.String |
getAbilityQualityDesc(Ability A) |
Returns a description of the quality of the
given skill.
|
java.lang.String |
getAbilityRangeDesc(Ability A) |
Returns a description of the range of the given skill.
|
java.lang.String |
getAbilityTargetDesc(Ability A) |
Returns a description of the valid targets of the given skill.
|
java.lang.String |
getActualAbilityUsageDesc(Ability A,
int whichUsageCode,
MOB forM) |
Returns a description of the amount of a particular cost is required
by the given mob to use the given ability.
|
protected java.lang.String |
getActualUsage(Ability A,
int whichUsageCode) |
|
protected java.lang.String |
getActualUsageInternal(Ability A,
int whichUsageCode,
MOB forM) |
|
java.util.Properties |
getArcHelpFile() |
Returns the cache for the archon help entries.
|
java.util.Properties |
getHelpFile() |
Returns the cache for the main help entries.
|
java.util.List<java.lang.String> |
getHelpList(java.lang.String helpStr,
java.util.Properties rHelpFile1,
java.util.Properties rHelpFile2,
MOB forM) |
Returns a list of help entries containing the given string, as an aid
in search.
|
Pair<java.lang.String,java.lang.String> |
getHelpMatch(java.lang.String helpStr,
java.util.Properties rHelpFile,
MOB forM,
int skipEntries) |
Returns a viewable help entry for the given key, checking the given
help file and returning the matching key and help text.
|
java.lang.String |
getHelpText(java.lang.String helpStr,
MOB forM,
boolean favorAHelp) |
Returns a viewable help entry for the given key.
|
java.lang.String |
getHelpText(java.lang.String helpStr,
MOB forM,
boolean favorAHelp,
boolean noFix) |
Returns a viewable help entry for the given key.
|
protected java.lang.String |
getHelpText(java.lang.String helpKey,
java.util.Properties rHelpFile,
MOB forM,
boolean noFix) |
|
protected Pair<java.lang.String,java.lang.String> |
getHelpText(java.lang.String helpKey,
java.util.Properties rHelpFile,
MOB forM,
boolean noFix,
int[] skip) |
|
java.lang.String |
getRPProficiencyStr(int proficiency) |
Returns the official description of a skill proficiency value.
|
java.util.List<java.lang.String> |
getSeeAlsoHelpOn(MOB mob,
java.util.Properties rHelpFile,
java.lang.String helpSearch,
java.lang.String helpKey,
java.lang.String helpText,
int howMany) |
Given the original search term, and the matching helpKey and helpText and mob, this
will find any other help keys that might be relevant to the search, returning
the list of also-matching results.
|
java.util.List<java.lang.String> |
getTopics(boolean archonHelp,
boolean standardHelp) |
Returns a list of all help keys.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
boolean |
isPlayerSkill(java.lang.String helpStr) |
Returns whether the given string resembles a key for
a player qualifying skill, or if the entry has common
skill help markers.
|
protected java.lang.String |
normalizeHelpText(java.lang.String helpText,
int[] skip) |
|
boolean |
shutdown() |
Shuts down the library.
|
void |
unloadHelpFile(MOB mob) |
Unloads the help file cache, forcing the cache to be repopulated from
the filesystem on next access.
|
activate, getServiceClient, L, propertiesLoaded
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, tick
protected final java.util.Map<java.lang.String,java.lang.String> genUsageCost
protected static final java.lang.String[] SKILL_PREFIXES
protected static final java.lang.String[] SKILL_SUFFIXES
protected final int[] proficiencyRanges
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public boolean isPlayerSkill(java.lang.String helpStr)
HelpLibrary
isPlayerSkill
in interface HelpLibrary
helpStr
- the possible skill keypublic java.lang.String getRPProficiencyStr(int proficiency)
HelpLibrary
getRPProficiencyStr
in interface HelpLibrary
proficiency
- the proficiency value 0-100public java.lang.String getHelpText(java.lang.String helpStr, MOB forM, boolean favorAHelp)
HelpLibrary
getHelpText
in interface HelpLibrary
helpStr
- the keyforM
- the mob to get info forfavorAHelp
- true to search archon help firstHelpLibrary.getArcHelpFile()
,
HelpLibrary.getHelpFile()
public java.lang.String getHelpText(java.lang.String helpStr, MOB forM, boolean favorAHelp, boolean noFix)
HelpLibrary
getHelpText
in interface HelpLibrary
helpStr
- the keyforM
- the mob to get info forfavorAHelp
- true to search archon help firstnoFix
- true to skip post-processing, false otherwiseHelpLibrary.getArcHelpFile()
,
HelpLibrary.getHelpFile()
public java.util.List<java.lang.String> getTopics(boolean archonHelp, boolean standardHelp)
HelpLibrary
getTopics
in interface HelpLibrary
archonHelp
- true to include archon keys, false otherwisestandardHelp
- true to include normal keys, false otherwiseprotected java.lang.String getActualUsageInternal(Ability A, int whichUsageCode, MOB forM)
public java.lang.String getAbilityQualityDesc(Ability A)
HelpLibrary
getAbilityQualityDesc
in interface HelpLibrary
A
- the Ability in questionpublic java.lang.String getAbilityCostDesc(Ability A, MOB forM)
HelpLibrary
getAbilityCostDesc
in interface HelpLibrary
A
- the Ability in questionforM
- the mob to get info forpublic java.lang.String getAbilityRangeDesc(Ability A)
HelpLibrary
getAbilityRangeDesc
in interface HelpLibrary
A
- the Ability in questionpublic java.lang.String getAbilityTargetDesc(Ability A)
HelpLibrary
getAbilityTargetDesc
in interface HelpLibrary
A
- the Ability in questionpublic java.lang.String getActualAbilityUsageDesc(Ability A, int whichUsageCode, MOB forM)
HelpLibrary
getActualAbilityUsageDesc
in interface HelpLibrary
A
- the Ability to find usage forwhichUsageCode
- the Ability.USAGE_ code.forM
- null, or a mob to make the report more specificAbility.USAGE_DESCS
protected java.lang.String getActualUsage(Ability A, int whichUsageCode)
public void addHelpEntry(java.lang.String ID, java.lang.String text, boolean archon)
HelpLibrary
addHelpEntry
in interface HelpLibrary
ID
- the key of the help entrytext
- the full text of the help entryarchon
- true to add to archon ahelp entries, false for normalprotected java.lang.String columnHelper(java.lang.String word, java.lang.String msg, int wrap)
public java.lang.String fixHelp(java.lang.String tag, java.lang.String str, MOB forM)
HelpLibrary
fixHelp
in interface HelpLibrary
tag
- the keystr
- the help text to post-processforM
- the mob for whom the help is intendedpublic Pair<java.lang.String,java.lang.String> getHelpMatch(java.lang.String helpStr, java.util.Properties rHelpFile, MOB forM, int skipEntries)
HelpLibrary
getHelpMatch
in interface HelpLibrary
helpStr
- the keyrHelpFile
- the help file cache to useforM
- the mob to get info forskipEntries
- number of matches to skip before returning the next oneHelpLibrary.getArcHelpFile()
,
HelpLibrary.getHelpFile()
protected java.lang.String normalizeHelpText(java.lang.String helpText, int[] skip)
protected java.lang.String getHelpText(java.lang.String helpKey, java.util.Properties rHelpFile, MOB forM, boolean noFix)
protected Pair<java.lang.String,java.lang.String> getHelpText(java.lang.String helpKey, java.util.Properties rHelpFile, MOB forM, boolean noFix, int[] skip)
public java.util.List<java.lang.String> getHelpList(java.lang.String helpStr, java.util.Properties rHelpFile1, java.util.Properties rHelpFile2, MOB forM)
HelpLibrary
getHelpList
in interface HelpLibrary
helpStr
- the string to search forrHelpFile1
- the first help cache to prioritizerHelpFile2
- null, or the second help cache to prioritizeforM
- the mob for whom help entries are searchedHelpLibrary.getArcHelpFile()
,
HelpLibrary.getHelpFile()
public java.util.Properties getArcHelpFile()
HelpLibrary
getArcHelpFile
in interface HelpLibrary
public java.util.Properties getHelpFile()
HelpLibrary
getHelpFile
in interface HelpLibrary
public java.lang.String findHelpFile(java.lang.String key, HelpLibrary.HelpSection searchSection, boolean exactOnly)
HelpLibrary
findHelpFile
in interface HelpLibrary
key
- the official help key to look forsearchSection
- how to search for keysexactOnly
- true to return only exact match, false to get bestHelpLibrary.addModifyHelpEntry(MOB, String, String, boolean)
public boolean addModifyHelpEntry(MOB mob, java.lang.String helpFile, java.lang.String helpKey, boolean deleteOnly)
HelpLibrary
addModifyHelpEntry
in interface HelpLibrary
mob
- the mob who wants to add/edithelpFile
- the help file to edithelpKey
- the help file key entry to editdeleteOnly
- true to delete the entry onlyHelpLibrary.findHelpFile(String, HelpSection, boolean)
public java.util.List<java.lang.String> getSeeAlsoHelpOn(MOB mob, java.util.Properties rHelpFile, java.lang.String helpSearch, java.lang.String helpKey, java.lang.String helpText, int howMany)
HelpLibrary
getSeeAlsoHelpOn
in interface HelpLibrary
mob
- the mob who wants more optionsrHelpFile
- the help files to base see also onhelpSearch
- the original search wordshelpKey
- the officially found help keyhelpText
- the officially processed and found help texthowMany
- the maximum number of options to returnpublic void unloadHelpFile(MOB mob)
HelpLibrary
unloadHelpFile
in interface HelpLibrary
mob
- null, or a mob to notify after the unload is completed.public boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()