CMObject
, Tickable
, CMLibrary
, SocialsList
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class Socials extends StdLibrary implements SocialsList
Modifier and Type | Field | Description |
---|---|---|
java.lang.String |
filename |
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 |
---|---|
Socials() |
Modifier and Type | Method | Description |
---|---|---|
void |
addSocial(Social S) |
Adds a single social target to its cached set in this
collection/manager.
|
void |
delSocial(java.lang.String name) |
Removes the entire social set of the given name, including
all of its variations.
|
protected java.util.List<Social> |
enumSocialSet(int index) |
|
Social |
fetchSocial(java.lang.String fullSocialID,
boolean exactOnly) |
Given a full social id, this will return the Social object, either
matching exactly, or doing a softer search.
|
Social |
fetchSocial(java.lang.String baseName,
Environmental targetE,
java.lang.String arg,
boolean exactOnly) |
Given a potential social name, a target object, and a possible trailing arg, this
will find and return the social that matches.
|
protected Social |
fetchSocial(java.util.List<Social> socials,
java.lang.String fullSocialID,
boolean exactOnly) |
|
protected Social |
fetchSocial(java.util.List<Social> socials,
java.lang.String targetCode,
java.lang.String arg,
boolean exactOnly) |
|
Social |
fetchSocial(java.util.List<java.lang.String> commands,
boolean exactOnly,
boolean checkItemTargets) |
Given a parsed user command line entry, this will search the socials for a likely social
object match, and return it.
|
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 |
fetchSocialFromSet(java.util.Map<java.lang.String,java.util.List<Social>> socialsMap,
java.util.List<java.lang.String> commands,
boolean exactOnly,
boolean checkItemTargets) |
Given an external map of base names to social sets, and a parsed command line from a
user, this will attempt to find if one of the socials appears in the map, and return
it.
|
java.lang.String |
findSocialBaseName(java.lang.String named,
boolean exactOnly) |
Given a social name to match, it will search for and return the base name.
|
protected java.lang.String |
findSocialName(java.util.Map<java.lang.String,java.util.List<Social>> soc,
java.lang.String named,
boolean exactOnly) |
|
java.util.Enumeration<Social> |
getAllSocials() |
Returns an enumeration of every social object, of
every base name, and every target.
|
protected java.util.Map<java.lang.String,java.util.List<Social>> |
getSocialHash() |
|
java.util.List<java.lang.String> |
getSocialsBaseList() |
Returns a cached list of all social base names.
|
java.lang.String |
getSocialsBaseTable() |
Creates 4 column list of all social base names.
|
java.lang.String |
getSocialsHelp(MOB mob,
java.lang.String named) |
Gets the full details on every target variation
of the social set with the given name, for the
given mob viewer.
|
java.util.List<Social> |
getSocialsSet(java.lang.String named) |
Returns the social set of the given base name.
|
protected java.util.List<Social> |
getSocialsSet(java.util.Map<java.lang.String,java.util.List<Social>> socialsMap,
java.lang.String named,
boolean exactOnly) |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
protected boolean |
isLoaded() |
|
Social |
makeDefaultSocial(java.lang.String name,
java.lang.String type) |
Create a default social object of the given base name,
and the given target type, such as ALL, S-NAME, SELF,
etc.
|
boolean |
modifySocialInterface(MOB mob,
java.util.List<Social> socials,
java.lang.String name,
java.lang.String rest) |
Provides the entire command line editor for creating or
modifying a social set.
|
protected void |
modifySocialOthersCode(MOB mob,
Social me,
int showNumber,
int showFlag) |
|
protected void |
modifySocialSourceCode(MOB mob,
Social me,
int showNumber,
int showFlag) |
|
protected void |
modifySocialTargetCode(MOB mob,
Social me,
int showNumber,
int showFlag) |
|
protected int |
numSocialSets() |
|
protected void |
put(java.lang.String name,
Social S) |
|
int |
putSocialsInHash(java.util.Map<java.lang.String,java.util.List<Social>> socialsMap,
java.util.List<java.lang.String> lines) |
Given a private map of base social names to social sets, this will populate that map from a
list of parseable social lines, where the format is:
12\tID\tYouSee\tOthersSee\tTargetSees\tNoTargetSees\tMSP filename\tZappermask\t
1 = source code, 2 = others/target code
|
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) |
On behalf of the given mob, saves the cached socials to
the default file in /resources/socials.txt
|
boolean |
shutdown() |
Shuts down the library.
|
void |
unloadSocials() |
Unloads all the internally hashed socials for reloading later.
|
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
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public int putSocialsInHash(java.util.Map<java.lang.String,java.util.List<Social>> socialsMap, java.util.List<java.lang.String> lines)
SocialsList
putSocialsInHash
in interface SocialsList
socialsMap
- the map to put the socials intolines
- the lines to parseSocialsList.fetchSocialFromSet(Map, List, boolean, boolean)
protected java.util.Map<java.lang.String,java.util.List<Social>> getSocialHash()
protected boolean isLoaded()
protected void put(java.lang.String name, Social S)
public void delSocial(java.lang.String name)
SocialsList
delSocial
in interface SocialsList
name
- the full or partial/base social nameSocialsList.addSocial(Social)
public void addSocial(Social S)
SocialsList
addSocial
in interface SocialsList
S
- the social objectSocialsList.delSocial(String)
protected int numSocialSets()
public void unloadSocials()
SocialsList
unloadSocials
in interface SocialsList
public boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()
protected void modifySocialOthersCode(MOB mob, Social me, int showNumber, int showFlag) throws java.io.IOException
java.io.IOException
protected void modifySocialTargetCode(MOB mob, Social me, int showNumber, int showFlag) throws java.io.IOException
java.io.IOException
protected void modifySocialSourceCode(MOB mob, Social me, int showNumber, int showFlag) throws java.io.IOException
java.io.IOException
protected static final java.lang.String replaceFirstWordStartsWith(java.lang.String str, java.lang.String thisStr, java.lang.String withThisStr)
str
- the string to look inside ofthisStr
- the string to look for inside the first stringwithThisStr
- the string to replace the second string with, if found.public boolean modifySocialInterface(MOB mob, java.util.List<Social> socials, java.lang.String name, java.lang.String rest) throws java.io.IOException
SocialsList
modifySocialInterface
in interface SocialsList
mob
- the mob editorsocials
- the social id or base namename
- the social namerest
- any extra terms used from command linejava.io.IOException
- any i/o errors that occured, usually disconnectprotected Social fetchSocial(java.util.List<Social> socials, java.lang.String targetCode, java.lang.String arg, boolean exactOnly)
protected Social fetchSocial(java.util.List<Social> socials, java.lang.String fullSocialID, boolean exactOnly)
public Social fetchSocial(java.lang.String baseName, Environmental targetE, java.lang.String arg, boolean exactOnly)
SocialsList
fetchSocial
in interface SocialsList
baseName
- the hopeful social base nametargetE
- the target representing the social targetarg
- a remaining argument, or ""exactOnly
- true for exact social match, or false for looserSocialsList.fetchSocial(List, boolean, boolean)
,
SocialsList.fetchSocial(String, boolean)
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)
public Social fetchSocial(java.lang.String fullSocialID, boolean exactOnly)
SocialsList
fetchSocial
in interface SocialsList
fullSocialID
- the full social id, with base name and targetexactOnly
- true for exact match, or false for searchSocialsList.fetchSocial(List, boolean, boolean)
,
SocialsList.fetchSocial(String, Environmental, String, boolean)
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)
public Social fetchSocial(java.util.List<java.lang.String> commands, boolean exactOnly, boolean checkItemTargets)
SocialsList
fetchSocial
in interface SocialsList
commands
- the parsed user command lineexactOnly
- true for exact base name match onlycheckItemTargets
- true to consider I-NAME target socialsSocialsList.fetchSocial(String, Environmental, String, boolean)
,
SocialsList.fetchSocial(String, boolean)
public Social fetchSocialFromSet(java.util.Map<java.lang.String,java.util.List<Social>> socialsMap, java.util.List<java.lang.String> commands, boolean exactOnly, boolean checkItemTargets)
SocialsList
fetchSocialFromSet
in interface SocialsList
socialsMap
- the map of base names to social setscommands
- the parsed user command lineexactOnly
- true for only perfect exact matchescheckItemTargets
- true to check I-NAME type targetsSocialsList.putSocialsInHash(Map, List)
protected java.util.List<Social> enumSocialSet(int index)
public Social makeDefaultSocial(java.lang.String name, java.lang.String type)
SocialsList
makeDefaultSocial
in interface SocialsList
name
- baseName of the social to createtype
- the target type, or ""public void save(MOB whom)
SocialsList
save
in interface SocialsList
whom
- the saverpublic java.util.List<Social> getSocialsSet(java.lang.String named)
SocialsList
getSocialsSet
in interface SocialsList
named
- the social base namepublic java.lang.String findSocialBaseName(java.lang.String named, boolean exactOnly)
SocialsList
findSocialBaseName
in interface SocialsList
named
- the whole or partial or full social name of itexactOnly
- true for exact base name matchprotected java.util.List<Social> getSocialsSet(java.util.Map<java.lang.String,java.util.List<Social>> socialsMap, java.lang.String named, boolean exactOnly)
protected java.lang.String findSocialName(java.util.Map<java.lang.String,java.util.List<Social>> soc, java.lang.String named, boolean exactOnly)
public java.lang.String getSocialsHelp(MOB mob, java.lang.String named)
SocialsList
getSocialsHelp
in interface SocialsList
mob
- the viewer mob, or nullnamed
- search base namepublic java.util.List<java.lang.String> getSocialsBaseList()
SocialsList
getSocialsBaseList
in interface SocialsList
public java.util.Enumeration<Social> getAllSocials()
SocialsList
getAllSocials
in interface SocialsList
public java.lang.String getSocialsBaseTable()
SocialsList
getSocialsBaseTable
in interface SocialsList