com.planet_ink.coffee_mud.Libraries
Class Socials

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

public class Socials
extends StdLibrary
implements SocialsList


Field Summary
 
Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
isDebugging, name, serviceClient, tickStatus
 
Fields inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.SocialsList
filename
 
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
Socials()
           
 
Method Summary
 void addSocial(Social S)
           
 java.util.List<Social> enumSocialSet(int index)
           
 Social fetchSocial(java.util.List<Social> set, java.lang.String fullSocialID, boolean exactOnly)
           
 Social fetchSocial(java.util.List<Social> set, java.lang.String targetCode, java.lang.String arg, boolean exactOnly)
           
 Social fetchSocial(java.util.List<java.lang.String> C, boolean exactOnly, boolean checkItemTargets)
           
protected  Social fetchSocial(java.util.Map<java.lang.String,java.util.List<Social>> soc, java.lang.String baseName, Environmental targetE, java.lang.String arg, boolean exactOnly)
           
protected  Social fetchSocial(java.util.Map<java.lang.String,java.util.List<Social>> soc, java.lang.String baseName, java.lang.String target, java.lang.String arg, boolean exactOnly)
           
 Social fetchSocial(java.lang.String fullSocialID, boolean exactOnly)
           
 Social fetchSocial(java.lang.String baseName, Environmental targetE, java.lang.String arg, boolean exactOnly)
           
 Social fetchSocialFromSet(java.util.Map<java.lang.String,java.util.List<Social>> soc, java.util.List<java.lang.String> C, boolean exactOnly, boolean checkItemTargets)
           
protected  java.lang.String findSocialName(java.util.Map<java.lang.String,java.util.List<Social>> soc, java.lang.String named, boolean exactOnly)
           
 java.lang.String findSocialName(java.lang.String named, boolean exactOnly)
           
 java.util.Enumeration<Social> getAllSocials()
           
 java.util.Map<java.lang.String,java.util.List<Social>> getSocialHash()
           
 java.lang.String getSocialsHelp(MOB mob, java.lang.String named, boolean exact)
           
 java.util.List<java.lang.String> getSocialsList()
           
 java.util.List<Social> getSocialsSet(java.lang.String named)
           
protected  java.util.List<Social> getSocialsSet(java.lang.String named, boolean exactOnly)
           
 java.lang.String getSocialsTable()
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isLoaded()
           
 Social makeDefaultSocial(java.lang.String name, java.lang.String type)
           
 boolean modifySocialInterface(MOB mob, java.lang.String socialString)
           
 void modifySocialOthersCode(MOB mob, Social me, int showNumber, int showFlag)
           
 void modifySocialSourceCode(MOB mob, Social me, int showNumber, int showFlag)
           
 void modifySocialTargetCode(MOB mob, Social me, int showNumber, int showFlag)
           
 int numSocialSets()
           
 void put(java.lang.String name, Social S)
           
 void putSocialsInHash(java.util.Map<java.lang.String,java.util.List<Social>> soc, java.util.List<java.lang.String> lines)
           
 void remove(java.lang.String name)
           
protected static java.lang.String replaceFirstWordStartsWith(java.lang.String str, java.lang.String thisStr, java.lang.String withThisStr)
          Finds the first and only the first instance of the second parameter string in the first string, and replaces it with the third string.
 void save(MOB whom)
           
 boolean shutdown()
          Shuts down the library.
 void unloadSocials()
           
 
Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary
activate, 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
activate, 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
 

Constructor Detail

Socials

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

putSocialsInHash

public void putSocialsInHash(java.util.Map<java.lang.String,java.util.List<Social>> soc,
                             java.util.List<java.lang.String> lines)
Specified by:
putSocialsInHash in interface SocialsList

getSocialHash

public java.util.Map<java.lang.String,java.util.List<Social>> getSocialHash()

isLoaded

public boolean isLoaded()
Specified by:
isLoaded in interface SocialsList

put

public void put(java.lang.String name,
                Social S)
Specified by:
put in interface SocialsList

remove

public void remove(java.lang.String name)
Specified by:
remove in interface SocialsList

addSocial

public void addSocial(Social S)
Specified by:
addSocial in interface SocialsList

numSocialSets

public int numSocialSets()
Specified by:
numSocialSets in interface SocialsList

unloadSocials

public void unloadSocials()
Specified by:
unloadSocials in interface SocialsList

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

modifySocialOthersCode

public void modifySocialOthersCode(MOB mob,
                                   Social me,
                                   int showNumber,
                                   int showFlag)
                            throws java.io.IOException
Specified by:
modifySocialOthersCode in interface SocialsList
Throws:
java.io.IOException

modifySocialTargetCode

public void modifySocialTargetCode(MOB mob,
                                   Social me,
                                   int showNumber,
                                   int showFlag)
                            throws java.io.IOException
Specified by:
modifySocialTargetCode in interface SocialsList
Throws:
java.io.IOException

modifySocialSourceCode

public void modifySocialSourceCode(MOB mob,
                                   Social me,
                                   int showNumber,
                                   int showFlag)
                            throws java.io.IOException
Specified by:
modifySocialSourceCode in interface SocialsList
Throws:
java.io.IOException

replaceFirstWordStartsWith

protected static final java.lang.String replaceFirstWordStartsWith(java.lang.String str,
                                                                   java.lang.String thisStr,
                                                                   java.lang.String withThisStr)
Finds the first and only the first instance of the second parameter string in the first string, and replaces it with the third string. Returns the first string with or without changes. This method is case sensitive.

Parameters:
str - the string to look inside of
thisStr - the string to look for inside the first string
withThisStr - the string to replace the second string with, if found.
Returns:
the string modified, or not modified if no replacement was made.

modifySocialInterface

public boolean modifySocialInterface(MOB mob,
                                     java.lang.String socialString)
                              throws java.io.IOException
Specified by:
modifySocialInterface in interface SocialsList
Throws:
java.io.IOException

fetchSocial

public Social fetchSocial(java.util.List<Social> set,
                          java.lang.String targetCode,
                          java.lang.String arg,
                          boolean exactOnly)
Specified by:
fetchSocial in interface SocialsList

fetchSocial

public Social fetchSocial(java.util.List<Social> set,
                          java.lang.String fullSocialID,
                          boolean exactOnly)
Specified by:
fetchSocial in interface SocialsList

fetchSocial

public Social fetchSocial(java.lang.String baseName,
                          Environmental targetE,
                          java.lang.String arg,
                          boolean exactOnly)
Specified by:
fetchSocial in interface SocialsList

fetchSocial

protected Social fetchSocial(java.util.Map<java.lang.String,java.util.List<Social>> soc,
                             java.lang.String baseName,
                             Environmental targetE,
                             java.lang.String arg,
                             boolean exactOnly)

fetchSocial

public Social fetchSocial(java.lang.String fullSocialID,
                          boolean exactOnly)
Specified by:
fetchSocial in interface SocialsList

fetchSocial

protected Social fetchSocial(java.util.Map<java.lang.String,java.util.List<Social>> soc,
                             java.lang.String baseName,
                             java.lang.String target,
                             java.lang.String arg,
                             boolean exactOnly)

fetchSocial

public Social fetchSocial(java.util.List<java.lang.String> C,
                          boolean exactOnly,
                          boolean checkItemTargets)
Specified by:
fetchSocial in interface SocialsList

fetchSocialFromSet

public Social fetchSocialFromSet(java.util.Map<java.lang.String,java.util.List<Social>> soc,
                                 java.util.List<java.lang.String> C,
                                 boolean exactOnly,
                                 boolean checkItemTargets)
Specified by:
fetchSocialFromSet in interface SocialsList

enumSocialSet

public java.util.List<Social> enumSocialSet(int index)
Specified by:
enumSocialSet in interface SocialsList

makeDefaultSocial

public Social makeDefaultSocial(java.lang.String name,
                                java.lang.String type)
Specified by:
makeDefaultSocial in interface SocialsList

save

public void save(MOB whom)
Specified by:
save in interface SocialsList

getSocialsSet

public java.util.List<Social> getSocialsSet(java.lang.String named)
Specified by:
getSocialsSet in interface SocialsList

findSocialName

public java.lang.String findSocialName(java.lang.String named,
                                       boolean exactOnly)
Specified by:
findSocialName in interface SocialsList

getSocialsSet

protected java.util.List<Social> getSocialsSet(java.lang.String named,
                                               boolean exactOnly)

findSocialName

protected java.lang.String findSocialName(java.util.Map<java.lang.String,java.util.List<Social>> soc,
                                          java.lang.String named,
                                          boolean exactOnly)

getSocialsHelp

public java.lang.String getSocialsHelp(MOB mob,
                                       java.lang.String named,
                                       boolean exact)
Specified by:
getSocialsHelp in interface SocialsList

getSocialsList

public java.util.List<java.lang.String> getSocialsList()
Specified by:
getSocialsList in interface SocialsList

getAllSocials

public java.util.Enumeration<Social> getAllSocials()
Specified by:
getAllSocials in interface SocialsList

getSocialsTable

public java.lang.String getSocialsTable()
Specified by:
getSocialsTable in interface SocialsList