CMObject, Tickable, ClanManager, CMLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>public class Clans extends StdLibrary implements ClanManager
| Modifier and Type | Field | Description |
|---|---|---|
protected SHashtable<java.lang.String,Clan> |
all |
|
protected java.util.List<Pair<Clan,java.lang.Integer>> |
all2 |
|
protected ClanManager[] |
clanLibList |
|
protected java.util.Map<java.lang.String,java.lang.String> |
clanWebPathMappings |
|
protected long |
lastGovernmentLoad |
|
protected java.util.Map<java.lang.String,Clan> |
webPathClanMappings |
|
protected SHashtable<java.lang.String,java.lang.Object> |
xpAwardMap |
idConverterisDebugging, name, serviceClient, tickStatusSTATUS_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 |
|---|---|
Clans() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
activate() |
Activates the library.
|
void |
addClan(Clan C) |
Adds the given clan to the games list
|
int |
adjustXPAward(Clan.Trophy trophy,
int exp) |
Adjust the given experience by the award granted by the given trophy.
|
protected void |
awardTrophyPrize(Clan winnerC,
Clan.Trophy trophy) |
|
boolean |
checkClanPrivilege(MOB mob,
Clan.Function func) |
Returns whether the given clan set contains a clan that
allows the given mob to do the given function in the clan.
|
boolean |
checkClanPrivilege(MOB mob,
java.lang.String clanID,
Clan.Function func) |
Returns whether the given mob belongs to the given clan, and if
so, whether they can do the given function in the clan.
|
void |
clanAnnounce(MOB mob,
java.lang.String msg) |
Makes an announcement to the clan announcement channel from
the given mob.
|
protected void |
clanAnnounceAll(java.lang.String msg) |
|
void |
clanDues() |
|
java.lang.Iterable<Pair<Clan,java.lang.Integer>> |
clanRoles() |
Returns all clans and their last-cached accept-positions
The auto-positions may be inaccurate.
|
java.util.Enumeration<Clan> |
clans() |
Returns an enumeration of all the Clans in the game
|
java.util.Enumeration<java.lang.String> |
clansNames() |
Returns a list of all available clans names in the game,
as Clan objects.
|
java.util.Enumeration<java.lang.String> |
clansNamesAllHosts() |
Returns a list of all available clan names for all clan
managers that share a single map.
|
void |
clanTrophyScan() |
|
ClanGovernment |
createGovernment(java.lang.String name) |
Creates the new stock government
|
ClanGovernment |
createSampleGovernment() |
Creates, but does not add, a sample government object
|
Clan |
fetchClanAnyHost(java.lang.String id) |
Returns the Clan object associated with the given clan name
from any host sharing the same map as the caller,
strictly matching, case insensitive
|
protected int |
filterMedianLevel(java.util.List<Clan.FullMemberRecord> members) |
|
boolean |
findAnyClanRelations(MOB M1,
MOB M2,
int relation) |
This method is used to determine the basic relationship between two mobs clans.
|
Clan |
findClan(java.lang.String id) |
Returns the Clan object associated with the given clan name, or
if the name is not found, the name that most closely matches it.
|
java.util.List<Triad<Clan,java.lang.Integer,java.lang.Integer>> |
findCommonRivalrousClans(MOB mob1,
MOB mob2) |
Searches for all clans that can be rivalrous with other clans that are
commonly shared between two mobs, along with their two roles
|
Clan |
findConquerableClan(MOB mob) |
Searches for a clan in the list that can be conquerable with other clans.
|
java.lang.String |
findGovernmentName(java.lang.String named,
boolean exact) |
Find the name of a government, or, if exactness is not
required, a position in a government.
|
Pair<Clan,java.lang.Integer> |
findPrivilegedClan(MOB mob,
Clan.Function func) |
If the given mob belongs to a clan, and if they can do the
given function in a clan, this will return that clan object
and the integer.
|
java.util.List<Pair<Clan,java.lang.Integer>> |
findPrivilegedClans(MOB mob,
Clan.Function func) |
If the given mob belongs to a clan, and if they can do the
given function in a clan, this will return those clan objects
and their role integer.
|
Clan |
findRivalrousClan(MOB mob) |
Searches for a clan in the list that can be rivalrous with other clans.
|
java.util.List<Pair<Clan,java.lang.Integer>> |
findRivalrousClans(MOB mob) |
Searches for all clans that can be rivalrous with other clans.
|
java.util.List<Pair<Clan,java.lang.Integer>> |
findRivalrousClans(MOB clanSourceMob,
MOB filterMob) |
Returns a list of clans that the source mob belongs to which the filter
mob does NOT also belong.
|
protected java.util.List<Pair<Clan,Clan>> |
findUncommonRivalrousClans(MOB M1,
MOB M2) |
|
void |
forceTick() |
Force the clans maintenance thread
|
protected java.util.List<Pair<Clan,Clan>> |
getAllClanPairs(MOB M1,
MOB M2) |
|
java.util.List<Clan> |
getAllCommonClanRelations(Clan C,
int rel) |
Returns all existing clans who have the given common relationship with
the given clan.
|
Clan |
getClan(java.lang.String id) |
Returns the Clan object associated with the given clan name
or which is a substring of a clan name
|
Clan |
getClanAnyHost(java.lang.String id) |
Returns the Clan object associated with the given clan name
from any host sharing the same map as the caller.
|
Clan |
getClanExact(java.lang.String id) |
Returns the Clan object associated with the given clan name
strictly matching, case insensitive
|
java.util.List<Pair<Clan,java.lang.Integer>> |
getClansByCategory(MOB M,
java.lang.String category) |
Returns the list of clans this mob belongs to in the given category.
|
java.lang.String |
getClanWebTemplateDir(java.lang.String webPath) |
Returns the template vfs path associated with a given specific
web path.
|
int |
getCommonClanRelations(Clan C1,
Clan C2) |
This method is used to determine the basic relationship between two clans.
|
int |
getCommonClanRelations(java.lang.String clanID1,
java.lang.String clanID2) |
This method is used to determine the basic relationship between two clans.
|
ClanGovernment |
getDefaultGovernment() |
Returns the default government definition object.
|
java.lang.String |
getGovernmentHelp(MOB mob,
java.lang.String named) |
Returns help on the government type named, if it is available
|
long |
getLastGovernmentLoad() |
Get last time governments were loaded/updated
|
protected ClanManager[] |
getOtherClanLibAllHosts() |
|
ClanGovernment |
getStockGovernment(int typeid) |
Returns a government definition object of the given internal
stock clangovernments.xml id.
|
ClanGovernment[] |
getStockGovernments() |
Returns all government definition objects from internal
stock clangovernments.xml file.
|
protected Clan |
getTrophyWinner(Clan.Trophy trophy) |
|
Clan |
getWebPathClan(java.lang.String sitePath) |
Returns the clan which may or may not be assigned to the absolute file path specified.
|
Clan |
getWebPathClanMapping(java.lang.String webPath) |
Returns the clan associated with a given specific web path.
|
boolean |
goForward(MOB mob,
Clan C,
java.util.List<java.lang.String> commands,
Clan.Function function,
boolean voteIfNecessary) |
Examines the given command string, which is based on the given clan function code.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
protected java.lang.String |
indt(int x) |
|
boolean |
isAnyCommonClan(MOB M1,
MOB M2) |
Returns whether the two mobs share ANY common clans, even
non-rivalrous ones.
|
boolean |
isAtClanWar(MOB M1,
MOB M2) |
This method is used to determine the basic relationship between two clan members.
|
boolean |
isClanFriendly(MOB mob,
Clan C) |
Returns whether the given mob is in a friendly state with with given clan.
|
boolean |
isClanFriendly(MOB M1,
MOB M2) |
Returns whether the two given mobs are in a clan friendly state
with each other.
|
boolean |
isClanFriendly(MOB M1,
java.lang.String clanID) |
Returns whether the given mob is in a friendly state with with given clan.
|
boolean |
isCommonClanRelations(java.lang.String clanID1,
java.lang.String clanID2,
int relation) |
This method is used to determine the basic relationship between two clans.
|
boolean |
isFamilyOfMembership(MOB M,
java.util.List<Clan.MemberRecord> members) |
Returns whether the given MOB is a member of any of the families
represented by the given list of clan members.
|
protected boolean |
isMember(java.util.List<Clan.MemberRecord> members,
java.lang.String name) |
|
java.lang.String |
makeGovernmentXML(ClanGovernment gvt) |
Converts a given clan government object into xml.
|
java.lang.String |
makeGovernmentXML(ClanGovernment[] gvts) |
Converts a given clan government objects into xml.
|
int |
numClans() |
Returns the number of clans in the game.
|
ClanGovernment[] |
parseGovernmentXML(java.lang.StringBuffer xml) |
Converts xml into clan government objects.
|
void |
propertiesLoaded() |
This method is called whenever system properties are altered by the user.
|
void |
removeClan(Clan C) |
Removes the given clan from the games list
|
boolean |
removeGovernment(ClanGovernment government) |
Deletes the stock government..
|
void |
reSaveGovernmentsXML() |
Forces the stock governments to be re-saved to clangovernments.xml.
|
boolean |
shutdown() |
Shuts down the library.
|
boolean |
tick(Tickable ticking,
int tickID) |
this is the method which is called periodically by the threading engine.
|
void |
tickAllClans() |
Forces all clans to go through their maintenance process, which
normally only occurs infrequently.
|
java.lang.String |
translatePrize(Clan.Trophy trophy) |
Returns a descriptive name for the given trophy code number.
|
boolean |
trophySystemActive() |
Returns whether this mud has activated its trophy system for clans.
|
getServiceClient, LcopyOf, initializeClass, name, newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, setThreadStatusprotected SHashtable<java.lang.String,Clan> all
protected long lastGovernmentLoad
protected java.util.Map<java.lang.String,Clan> webPathClanMappings
protected java.util.Map<java.lang.String,java.lang.String> clanWebPathMappings
protected ClanManager[] clanLibList
protected SHashtable<java.lang.String,java.lang.Object> xpAwardMap
public java.lang.String ID()
CMObjectID in interface CMObjectID in class StdLibrarypublic boolean isCommonClanRelations(java.lang.String clanID1,
java.lang.String clanID2,
int relation)
ClanManagerisCommonClanRelations in interface ClanManagerclanID1 - the first clan to evaluateclanID2 - the second clan to evaluaterelation - the clan relation to compare toClan.REL_DESCSpublic boolean isAtClanWar(MOB M1, MOB M2)
ClanManagerisAtClanWar in interface ClanManagerM1 - the first mobs first rivalrous clan to evaluateM2 - the second mobs first rivalrous clan to evaluateClan.REL_DESCSpublic boolean isClanFriendly(MOB M1, MOB M2)
ClanManagerisClanFriendly in interface ClanManagerM1 - the first mob to checkM2 - the second mob to checkClanManager.isClanFriendly(MOB, Clan),
ClanManager.isClanFriendly(MOB, String)public boolean isClanFriendly(MOB mob, Clan C)
ClanManagerisClanFriendly in interface ClanManagermob - the mob to checkC - the clan to checkClanManager.isClanFriendly(MOB, String),
ClanManager.isClanFriendly(MOB, MOB)public boolean isClanFriendly(MOB M1, java.lang.String clanID)
ClanManagerisClanFriendly in interface ClanManagerM1 - the mob to checkclanID - the clan id to checkClanManager.isClanFriendly(MOB, Clan),
ClanManager.isClanFriendly(MOB, MOB)public boolean checkClanPrivilege(MOB mob, Clan.Function func)
ClanManagercheckClanPrivilege in interface ClanManagermob - the mob to check the clans offunc - the function to check forpublic boolean checkClanPrivilege(MOB mob, java.lang.String clanID, Clan.Function func)
ClanManagercheckClanPrivilege in interface ClanManagermob - the mob to look for privileges forclanID - the clanID to check for to check forfunc - the function to check forpublic Pair<Clan,java.lang.Integer> findPrivilegedClan(MOB mob, Clan.Function func)
ClanManagerfindPrivilegedClan in interface ClanManagermob - the mob to check the clans offunc - the function to check forpublic java.util.List<Pair<Clan,java.lang.Integer>> findPrivilegedClans(MOB mob, Clan.Function func)
ClanManagerfindPrivilegedClans in interface ClanManagermob - the mob to check the clans offunc - the function to check forpublic Clan findRivalrousClan(MOB mob)
ClanManagerfindRivalrousClan in interface ClanManagermob - the mob to check the clans ofpublic Clan findConquerableClan(MOB mob)
ClanManagerfindConquerableClan in interface ClanManagermob - the mob to check the clans ofpublic java.util.List<Triad<Clan,java.lang.Integer,java.lang.Integer>> findCommonRivalrousClans(MOB mob1, MOB mob2)
ClanManagerfindCommonRivalrousClans in interface ClanManagermob1 - the first mob to check the clans ofmob2 - the second mob to check the clans ofpublic java.util.List<Pair<Clan,java.lang.Integer>> findRivalrousClans(MOB mob)
ClanManagerfindRivalrousClans in interface ClanManagermob - the mob to check the clans ofpublic java.util.List<Pair<Clan,java.lang.Integer>> findRivalrousClans(MOB clanSourceMob, MOB filterMob)
ClanManagerfindRivalrousClans in interface ClanManagerclanSourceMob - the mob to source the clan list fromfilterMob - the mob to use to filter out source clansprotected java.util.List<Pair<Clan,Clan>> findUncommonRivalrousClans(MOB M1, MOB M2)
public int getCommonClanRelations(Clan C1, Clan C2)
ClanManagergetCommonClanRelations in interface ClanManagerC1 - the first clan to evaluateC2 - the second clan to evaluateClan.REL_DESCSpublic java.util.List<Clan> getAllCommonClanRelations(Clan C, int rel)
ClanManagergetAllCommonClanRelations in interface ClanManagerC - the clan to find relations withrel - the relationship to find, usually war or allypublic int getCommonClanRelations(java.lang.String clanID1,
java.lang.String clanID2)
ClanManagergetCommonClanRelations in interface ClanManagerclanID1 - the first clan to evaluateclanID2 - the second clan to evaluateClan.REL_DESCSpublic boolean findAnyClanRelations(MOB M1, MOB M2, int relation)
ClanManagerfindAnyClanRelations in interface ClanManagerM1 - the first mob whose clans to evaluateM2 - the second mob whose clans to evaluaterelation - the relation to look forClan.REL_DESCSpublic boolean isAnyCommonClan(MOB M1, MOB M2)
ClanManagerisAnyCommonClan in interface ClanManagerM1 - first mobM2 - second mobprotected ClanManager[] getOtherClanLibAllHosts()
public Clan getClan(java.lang.String id)
ClanManagergetClan in interface ClanManagerid - the clan nameClanpublic Clan getClanExact(java.lang.String id)
ClanManagergetClanExact in interface ClanManagerid - the clan nameClanpublic Clan fetchClanAnyHost(java.lang.String id)
ClanManagerfetchClanAnyHost in interface ClanManagerid - the clan nameClanpublic Clan getClanAnyHost(java.lang.String id)
ClanManagergetClanAnyHost in interface ClanManagerid - the clan nameClanpublic Clan findClan(java.lang.String id)
ClanManagerfindClan in interface ClanManagerid - the clan nameClanprotected boolean isMember(java.util.List<Clan.MemberRecord> members, java.lang.String name)
public boolean isFamilyOfMembership(MOB M, java.util.List<Clan.MemberRecord> members)
ClanManagerisFamilyOfMembership in interface ClanManagerM - the mob to evaluatemembers - the members of a clanpublic java.util.Enumeration<Clan> clans()
ClanManagerclans in interface ClanManagerpublic int numClans()
ClanManagernumClans in interface ClanManagerpublic void addClan(Clan C)
ClanManageraddClan in interface ClanManagerC - the clan to addpublic void removeClan(Clan C)
ClanManagerremoveClan in interface ClanManagerC - the clan to removepublic void tickAllClans()
ClanManagertickAllClans in interface ClanManagerprotected void clanAnnounceAll(java.lang.String msg)
public java.util.Enumeration<java.lang.String> clansNames()
ClanManagerclansNames in interface ClanManagerClanpublic java.util.Enumeration<java.lang.String> clansNamesAllHosts()
ClanManagerclansNamesAllHosts in interface ClanManagerpublic java.lang.Iterable<Pair<Clan,java.lang.Integer>> clanRoles()
ClanManagerclanRoles in interface ClanManagerpublic java.lang.String translatePrize(Clan.Trophy trophy)
ClanManagertranslatePrize in interface ClanManagertrophy - the trophy code numberClan.Trophypublic boolean trophySystemActive()
ClanManagertrophySystemActive in interface ClanManagerpublic boolean goForward(MOB mob, Clan C, java.util.List<java.lang.String> commands, Clan.Function function, boolean voteIfNecessary)
ClanManagergoForward in interface ClanManagermob - the player who wants to perform the functionC - the clan that the player belongs tocommands - the command list describing the function that wants to be executedfunction - the function code described by the commands listvoteIfNecessary - true to start a vote if one is needed, false to just return true.Clan.Function.ACCEPTprotected java.lang.String indt(int x)
public long getLastGovernmentLoad()
ClanManagergetLastGovernmentLoad in interface ClanManagerpublic java.lang.String findGovernmentName(java.lang.String named,
boolean exact)
ClanManagerfindGovernmentName in interface ClanManagernamed - the government name for exact, or position nameexact - true for exact match only, false otherwiseClanManager.getGovernmentHelp(MOB, String)public java.lang.String getGovernmentHelp(MOB mob, java.lang.String named)
ClanManagergetGovernmentHelp in interface ClanManagermob - the viewer of the government typenamed - the possible name of the governmentClanManager.findGovernmentName(String, boolean)public ClanGovernment createSampleGovernment()
ClanManagercreateSampleGovernment in interface ClanManagerpublic void reSaveGovernmentsXML()
ClanManagerreSaveGovernmentsXML in interface ClanManagerpublic ClanGovernment createGovernment(java.lang.String name)
ClanManagercreateGovernment in interface ClanManagername - governmentnamepublic boolean removeGovernment(ClanGovernment government)
ClanManagerremoveGovernment in interface ClanManagergovernment - the government to deletepublic ClanGovernment[] getStockGovernments()
ClanManagergetStockGovernments in interface ClanManagerClanGovernmentpublic ClanGovernment getDefaultGovernment()
ClanManagergetDefaultGovernment in interface ClanManagerClanGovernmentpublic ClanGovernment getStockGovernment(int typeid)
ClanManagergetStockGovernment in interface ClanManagertypeid - the internal typeidClanGovernmentpublic java.lang.String makeGovernmentXML(ClanGovernment gvt)
ClanManagermakeGovernmentXML in interface ClanManagergvt - the clan government objectClanGovernment,
ClanManager.makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment[]),
ClanManager.parseGovernmentXML(StringBuffer)public java.lang.String makeGovernmentXML(ClanGovernment[] gvts)
ClanManagermakeGovernmentXML in interface ClanManagergvts - the clan government objectsClanGovernment,
ClanManager.makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment),
ClanManager.parseGovernmentXML(StringBuffer)public java.util.List<Pair<Clan,java.lang.Integer>> getClansByCategory(MOB M, java.lang.String category)
ClanManagergetClansByCategory in interface ClanManagerM - the mob to evaluatecategory - the clan goverment categorypublic ClanGovernment[] parseGovernmentXML(java.lang.StringBuffer xml)
ClanManagerparseGovernmentXML in interface ClanManagerxml - the xmlClanGovernment,
ClanManager.makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment),
ClanManager.makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment[])public Clan getWebPathClanMapping(java.lang.String webPath)
ClanManagergetWebPathClanMapping in interface ClanManagerwebPath - a full vfs resource pathpublic java.lang.String getClanWebTemplateDir(java.lang.String webPath)
ClanManagergetClanWebTemplateDir in interface ClanManagerwebPath - a full vfs resource pathpublic Clan getWebPathClan(java.lang.String sitePath)
ClanManagergetWebPathClan in interface ClanManagersitePath - the absolute path of the web dir assigned to this clanpublic void clanAnnounce(MOB mob, java.lang.String msg)
ClanManagerclanAnnounce in interface ClanManagermob - the mob who is announcing the messagemsg - string message to send to the clan info channelsprotected int filterMedianLevel(java.util.List<Clan.FullMemberRecord> members)
protected Clan getTrophyWinner(Clan.Trophy trophy)
protected void awardTrophyPrize(Clan winnerC, Clan.Trophy trophy)
public void clanDues()
public void clanTrophyScan()
public int adjustXPAward(Clan.Trophy trophy, int exp)
ClanManageradjustXPAward in interface ClanManagertrophy - the trophy to awardexp - the amount of exp to possibly changepublic boolean activate()
CMLibraryactivate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()public boolean tick(Tickable ticking, int tickID)
Tickabletick in interface Tickabletick in class StdLibraryticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in TickableTickable,
ServiceEngine,
TickableGrouppublic boolean shutdown()
CMLibraryshutdown in interface CMLibraryshutdown in class StdLibraryCMLibrary.activate()public void forceTick()
ClanManagerforceTick in interface ClanManagerpublic void propertiesLoaded()
CMLibrarypropertiesLoaded in interface CMLibrarypropertiesLoaded in class StdLibrary