com.planet_ink.coffee_mud.Libraries.interfaces
Interface AutoTitlesLibrary

All Superinterfaces:
java.lang.Cloneable, CMLibrary, CMObject, java.lang.Comparable<CMObject>
All Known Implementing Classes:
AutoTitles

public interface AutoTitlesLibrary
extends CMLibrary

The library for managing the various auto-titles, which are player titles that can, according to a mask, be automatically added and removed from players as they meet, and stop meeting, various criterium.

See Also:
reloadAutoTitles()

Method Summary
 void appendAutoTitle(java.lang.String text)
          Appends to the list of titles from the given text and refreshes the cache.
 java.util.Enumeration<java.lang.String> autoTitles()
          Returns an enumerator of the auto-title strings themselves.
 java.lang.String deleteTitleAndResave(java.lang.String title)
          Removes the given title from all affected players, removes the given title from the titles properties file, and refreshes the titles cache.
 java.lang.String evaluateAutoTitle(java.lang.String row, boolean addIfPossible)
          Scans an admin-given auto-title definition string to see if it is properly formatted for adding to the list of auto-titles.
 boolean evaluateAutoTitles(MOB mob)
          Scans all existing titles to see if any should be added to the given mob.
 java.lang.String getAutoTitleInstructions()
          Reads the titles.ini file and returns the instructions therein.
 java.lang.String getAutoTitleMask(java.lang.String title)
          Returns the string mask attributed to a particular title string.
 boolean isExistingAutoTitle(java.lang.String title)
          Returns whether the given string matches one of the defined player titles.
 void reloadAutoTitles()
          Forces this library to re-load its list of titles from the resource file titles.ini.
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
activate, getServiceClient, L, propertiesLoaded, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

autoTitles

java.util.Enumeration<java.lang.String> autoTitles()
Returns an enumerator of the auto-title strings themselves. The strings will substitute a * character for the players name when building the final title.

Returns:
an enumerator of the auto-title strings themselves

getAutoTitleMask

java.lang.String getAutoTitleMask(java.lang.String title)
Returns the string mask attributed to a particular title string. The mask is as described by the masking library.

Parameters:
title - the title itself
Returns:
the zapper mask to determine who should get this title
See Also:
MaskingLibrary

isExistingAutoTitle

boolean isExistingAutoTitle(java.lang.String title)
Returns whether the given string matches one of the defined player titles.

Parameters:
title - the strong to match
Returns:
true if a title of that string exists, false otherwise

evaluateAutoTitle

java.lang.String evaluateAutoTitle(java.lang.String row,
                                   boolean addIfPossible)
Scans an admin-given auto-title definition string to see if it is properly formatted for adding to the list of auto-titles.

Parameters:
row - the admin-entered command string
addIfPossible - true to add it to the list, false to scan-only
Returns:
true if the title meets the criterium, false if it is rejected

evaluateAutoTitles

boolean evaluateAutoTitles(MOB mob)
Scans all existing titles to see if any should be added to the given mob. If any match, the title is added to the mobs list of choices, after being customized.

Parameters:
mob - the mob to check for new titles for
Returns:
true if any titles were added, false otherwise

reloadAutoTitles

void reloadAutoTitles()
Forces this library to re-load its list of titles from the resource file titles.ini.


appendAutoTitle

void appendAutoTitle(java.lang.String text)
Appends to the list of titles from the given text and refreshes the cache. This will also save the file.

Parameters:
text - the text of the new title definition

deleteTitleAndResave

java.lang.String deleteTitleAndResave(java.lang.String title)
Removes the given title from all affected players, removes the given title from the titles properties file, and refreshes the titles cache.

Parameters:
title - the title to remove
Returns:
an error message, or null for success

getAutoTitleInstructions

java.lang.String getAutoTitleInstructions()
Reads the titles.ini file and returns the instructions therein.

Returns:
the instructions for entering a title