com.planet_ink.coffee_mud.Common
Class DefaultClan

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultClan
All Implemented Interfaces:
Clan, CMCommon, CMObject, Modifiable, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultClan
extends java.lang.Object
implements Clan

Portions Copyright (c) 2003 Jeremy Vyska Portions Copyright (c) 2004-2018 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Clan
Clan.Authority, Clan.AutoPromoteFlag, Clan.ClanVote, Clan.FullMemberRecord, Clan.Function, Clan.MemberRecord, Clan.Trophy
 
Field Summary
protected  java.lang.String acceptanceSettings
           
protected  int autoPosition
           
protected  java.util.List<Pair<Clan,java.lang.Integer>> channelSet
           
protected  java.lang.String clanCategory
           
protected  java.lang.String clanClass
           
protected  java.lang.String clanDonationRoom
           
protected  java.util.List<java.lang.Long> clanKills
           
protected  int clanLevel
           
protected  java.lang.String clanMorgue
           
protected  java.lang.String clanName
           
protected  java.lang.String clanPremise
           
protected  java.lang.String clanRecall
           
protected  int clanStatus
           
protected  int clanTrophies
           
protected static java.util.List<Ability> empty
           
protected  long exp
           
protected  java.lang.Object expSync
           
protected  ItemCollection extItems
           
protected  int government
           
protected  ClanGovernment govt
           
protected  java.lang.Boolean isRivalrous
           
protected  java.lang.String lastClanKillRecord
           
protected  long lastGovernmentLoadTime
           
protected  long lastPropsReload
           
protected  long lastStatusChange
           
protected  java.lang.Integer overrideMinClanMembers
           
protected  java.util.Map<java.lang.String,long[]> relations
           
protected  double taxRate
           
protected  java.util.List<Clan.ClanVote> voteList
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Clan
CLAN_STATS, CLANSTATUS_ACTIVE, CLANSTATUS_DESC, CLANSTATUS_FADING, CLANSTATUS_PENDING, REL_ALLY, REL_COLORS, REL_DESCS, REL_FRIENDLY, REL_HOSTILE, REL_NEUTRAL, REL_NEUTRALITYGAUGE, REL_STATES, REL_WAR, RELATIONSHIP_VECTOR, VSTAT_DESCS, VSTAT_FAILED, VSTAT_PASSED, VSTAT_STARTED
 
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
DefaultClan()
           
 
Method Summary
 void addMember(MOB M, int role)
          Adds a new member to this clan
 void addVote(Clan.ClanVote CV)
          Adds a new ClanVote object to the list of ongoing votes for this
 void adjDeposit(MOB memberM, double howMuch)
          Adjusts the amount of base gold value deposited by this member.
 void adjExp(MOB memberM, int howMuch)
          Adjusts the amount of experience earned by this
 int applyExpMods(MOB memberM, int exp)
          Adjusts the amount of experience earned by a player based on the tax rate.
 long calculateMapPoints()
          Returns the total control points earned by this clan
 long calculateMapPoints(java.util.List<Area> controlledAreas)
          Returns the total control points represented by the list of controlled areas given.
 boolean canBeAssigned(MOB mob, int role)
          Returns whether the given user can be assigned the given role
 SearchIDList<Ability> clanAbilities(MOB mob)
          Return a vector of skills, spells, and other abilities granted to the given mob of the given mobs level.
 void clanAnnounce(java.lang.String msg)
          Sends a message to all members of all clans.
 ChameleonList<Ability> clanEffects(MOB mob)
          Return a vector of skills, spells, and other effects granted to the given mob of the given mobs level.
 java.lang.String clanID()
          Returns the unique identifying ID of the clan for reference elsewhere.
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 void create()
          Orders the system to create this clan in the database.
 void delMember(MOB M)
          Del a member from this clan
 void delVote(Clan.ClanVote CV)
          Removes a new ClanVote object from the list of ongoing votes for this
 void destroyClan()
          Orders the system to destroy this clan in the database.
 boolean doesOutRank(int highRoleID, int lowRoleID)
          Returns whether the high role id outranks the low roldid
 int filterMedianLevel(java.util.List<Clan.FullMemberRecord> members)
           
 java.util.List<Clan.MemberRecord> filterMemberList(java.util.List<? extends Clan.MemberRecord> members, int posFilter)
           
 MOB findMember(java.lang.String name)
          Returns the named member, if possible
 Clan.MemberRecord findMemberRecord(java.lang.String name)
          Returns the named member, if possible
 java.lang.String fixRequirementMask(java.lang.String oldMask)
           
 java.lang.String getAcceptanceSettings()
          Returns a mask used to identify whether a player is allowed to join a particular
 Clan.Authority getAuthority(int roleID, Clan.Function function)
          Returns whether the given roleID is allowed to perform the given function.
 int getAutoPosition()
          Returns whether membership is automatically approved to this And if so, what the default position for members are.
 java.lang.String getBasicRequirementMask()
          Returns the inner (government usually) requirements to even apply to this clan
 java.lang.String getCategory()
          Returns the category of the clan, which is almost always the same as the government category.
 java.lang.String getClanClass()
          Retrieves this Clan's enforced character class.
protected  CharClass getClanClassC()
           
 int getClanLevel()
          Returns the current clan level
 int getClanRelations(java.lang.String id)
          Returns a REL_* constant denoting the relationship between this clan and the clan of the given name.
 java.util.List<Area> getControlledAreas()
          Returns all the areas on the map controlled by this
 double getCurrentClanGoldDonations(MOB killer)
          Returns the amount of base gold value this clan has received.
 int getCurrentClanKills(MOB killer)
          Returns the number of other-clan kills this clan has recorded.
 long getCurrentClanXPDonations(MOB killer)
          Returns the amount of xp this clan has earned.
 java.lang.String getDetail(MOB mob)
          Creates the string for the 'clandetail' command, based on the security of the given mob who will view the details.
 java.lang.String getDonation()
          Returns the roomID of this clans donation room
 long getExp()
          Gets the amount of experience earned by this
 ItemCollection getExtItems()
          Gets external items belonging to this clan, which should be destroyed with the clan, but can still be transient.
 java.util.List<Clan.FullMemberRecord> getFullMemberList()
          Returns the set of members, where each row represents a FullMemberRecord
 ClanGovernment getGovernment()
          Returns the object representing the government of this
 int getGovernmentID()
          Returns the id representing the government type of this
 java.lang.String getGovernmentName()
          Returns Clan, Republic, or another one of the clan government types.
 long getLastRelationChange(java.lang.String id)
          Returns the time/date stamp when this clan last changed its relations with the given
 Clan.MemberRecord getMember(java.lang.String name)
           
 java.util.List<Clan.MemberRecord> getMemberList()
          Returns the set of members, where each row represents a MemberRecord
 java.util.List<Clan.MemberRecord> getMemberList(int posFilter)
          Returns the set of members, where each row represents a MemberRecord.
 int getMinClanMembers()
          Returns the minimum clan members for the clan to become active, or to prevent being purged.
 java.lang.String getMorgue()
          Returns the roomID of this clans morgue room
 int getMostInRole(int roleID)
          Returns the maximum number of players who can hold the given role in this For assignment purposes.
 java.lang.String getName()
          Returns the name of the clan, which is almost always the same as the ID, which is why clans can't change their names.
 int getNumberRoles()
          Returns the number of roles (max roleid)
 int getNumVoters(Clan.Function function)
          Returns the number of members allowed to vote on the given function.
 java.lang.String getPolitics()
          Returns an XML string used to identify the political relations between this clan and others.
 java.lang.String getPremise()
          Retrieves this Clan's basic story.
protected  java.util.List<Clan.MemberRecord> getRealMemberList(int PosFilter)
           
 java.lang.String getRecall()
          Returns the roomID of this clans recall room (their clan home)
 MOB getResponsibleMember()
          Returns the highest ranking member of this
 int getRoleFromName(java.lang.String position)
          For the clan government type, this function will return the clan role that most closely matches the given string "position".
 java.lang.String getRoleName(int roleID, boolean titleCase, boolean plural)
          Returns the friendly descriptive name of a given role in a clan, based on very specific criteria.
 java.lang.String[] getRolesList()
          Returns the list of roles for people in this clan, from lowest rank to the highest.
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 int getSize()
          Returns the number of members of this
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
 int getStatus()
          Returns one of the CLANSTAT_* constants describing the pending status of this clan for acceptable, or whether its one its way out.
 double getTaxes()
          Gets the tax rate for this
 int getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 int getTopQualifiedRoleID(Clan.Function func, MOB mob)
          Returns the roleid constant representing the highest rank in this clan type that can perform the given function or null.
 java.util.List<java.lang.Integer> getTopRankedRoles(Clan.Function func)
          Returns the roleid(s) constant representing the highest rank roleid(s) in this clan type that can perform the given function.
 int getTrophies()
          Returns a bitmap representing the trophies won by this The bitmap is made up of TROPHY_* constants.
protected  ClanGovernment govt()
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean isLoyaltyThroughItems()
          Returns whether this clan attains conquest loyalty through giving out clan items.
 boolean isOnlyFamilyApplicants()
          Returns whether this clan only accepts applicants from people who are family of current members/founder.
 boolean isPubliclyListedFor(MOB mob)
          Returns whether this clan gets listed with the clanlist command.
 boolean isRivalrous()
          Returns true if this clan is rivalrous with other rivalrous clans, meaning that pvp is enabled between them, and war can be declared between them.
protected  boolean isSafeFromPurge()
           
 boolean isStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 boolean isWorshipConquest()
          Returns whether this clan attains conquest loyalty through mobs worshiping the same deity as their leader.
 java.lang.String L(java.lang.String str, java.lang.String... xs)
           
 java.lang.String name()
          The nice displayable name of this instance of this object
 CMObject newInstance()
          return a new instance of the object
 int numClanEffects(MOB mob)
          Return size of a vector of skills, spells, and other effects granted to the given mob of the given mobs level.
 void recordClanKill(MOB killer, MOB killed)
          Called when a member of this clan kills a member of another Will update the clan in the database.
 void setAcceptanceSettings(java.lang.String newSettings)
          Sets a mask used to identify whether a player is allowed to join a particular
 void setAutoPosition(int pos)
          Sets whether membership is automatically approved to this And if so, what the default position for members are.
 void setCategory(java.lang.String newCategory)
          Sets a new category for this, which is almost always the same as the government category.
 void setClanClass(java.lang.String newClass)
          Sets this Clan's enforced character class.
 void setClanLevel(int newClanLevel)
          Sets the new clan level
 void setClanRelations(java.lang.String id, int rel, long time)
          Sets a new relationship between this clan and the clan with the given id.
 void setDonation(java.lang.String newDonation)
          Sets the roomID of this clans donation room
 void setExp(long newexp)
          Sets the amount of experience earned by this
 void setGovernmentID(int type)
          Returns the id constant representing the government type of this
 void setMinClanMembers(int amt)
          Sets the minimum clan members for the clan to become active, or to prevent being purged.
 void setMorgue(java.lang.String newMorgue)
          Sets the roomID of this clans morgue room
 void setName(java.lang.String newName)
          Sets a new name for this
 void setPolitics(java.lang.String politics)
          Sets an XML string used to identify the political relations between this clan and others.
 void setPremise(java.lang.String newPremise)
          Sets this Clan's basic story.
 void setRecall(java.lang.String newRecall)
          Sets the roomID of this clans recall room (their clan home)
 void setRivalrous(boolean isRivalrous)
          Set to true if this clan is rivalrous with other rivalrous clans, meaning that pvp is enabled between them, and war can be declared
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 void setStatus(int newStatus)
          Sets one of the CLANSTAT_* constants describing the pending status of this clan for acceptable, or whether its one its way out.
 void setTaxes(double rate)
          Sets the tax rate for this
 void setTrophies(int trophyFlag)
          Sets a bitmap representing the trophies won by this The bitmap is made up of TROPHY_* constants.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 void update()
          Orders the system to update this clan in the database.
 boolean updateClanPrivileges(MOB M)
          This method is called when a given mobs clan status changes, for instance if they are added to the clan, removed from it, or change their rank.
 void updateVotes()
          Orders the system to save any changes to existing ongoing votes for this
 java.util.Enumeration<Clan.ClanVote> votes()
          If the clan type allows voting, this returns a series of ClanVote objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clanName

protected java.lang.String clanName

clanCategory

protected java.lang.String clanCategory

clanPremise

protected java.lang.String clanPremise

clanRecall

protected java.lang.String clanRecall

clanMorgue

protected java.lang.String clanMorgue

clanClass

protected java.lang.String clanClass

clanLevel

protected int clanLevel

clanDonationRoom

protected java.lang.String clanDonationRoom

clanTrophies

protected int clanTrophies

isRivalrous

protected java.lang.Boolean isRivalrous

autoPosition

protected int autoPosition

acceptanceSettings

protected java.lang.String acceptanceSettings

clanStatus

protected int clanStatus

lastStatusChange

protected long lastStatusChange

lastClanKillRecord

protected java.lang.String lastClanKillRecord

taxRate

protected double taxRate

exp

protected volatile long exp

expSync

protected java.lang.Object expSync

voteList

protected java.util.List<Clan.ClanVote> voteList

clanKills

protected java.util.List<java.lang.Long> clanKills

overrideMinClanMembers

protected java.lang.Integer overrideMinClanMembers

lastPropsReload

protected long lastPropsReload

extItems

protected ItemCollection extItems

relations

protected java.util.Map<java.lang.String,long[]> relations

government

protected int government

lastGovernmentLoadTime

protected long lastGovernmentLoadTime

govt

protected ClanGovernment govt

empty

protected static final java.util.List<Ability> empty

channelSet

protected final java.util.List<Pair<Clan,java.lang.Integer>> channelSet
Constructor Detail

DefaultClan

public DefaultClan()
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
Returns:
the name of this class

getTickStatus

public int getTickStatus()
Description copied from interface: Tickable
A coded status for this object during the period where its tick method is being called. The statis is defined, at least in part, by constants in this interface STATUS_*. STATUS_NOT should be returned when the objects tick method is not currently in execution. It should never return STATUS_NOT when the objects tick method is in execution.

Specified by:
getTickStatus in interface Tickable
Returns:
the numeric status of this object
See Also:
Tickable.tick(Tickable, int)

newInstance

public CMObject newInstance()
return a new instance of the object

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

getGovernment

public ClanGovernment getGovernment()
Description copied from interface: Clan
Returns the object representing the government of this

Specified by:
getGovernment in interface Clan
Returns:
the if constant
See Also:
ClanGovernment, Clan.getGovernmentID(), Clan.setGovernmentID(int)

govt

protected ClanGovernment govt()

updateVotes

public void updateVotes()
Description copied from interface: Clan
Orders the system to save any changes to existing ongoing votes for this

Specified by:
updateVotes in interface Clan

addVote

public void addVote(Clan.ClanVote CV)
Description copied from interface: Clan
Adds a new ClanVote object to the list of ongoing votes for this

Specified by:
addVote in interface Clan
Parameters:
CV - the clanvote object to add
See Also:
Clan.ClanVote

delVote

public void delVote(Clan.ClanVote CV)
Description copied from interface: Clan
Removes a new ClanVote object from the list of ongoing votes for this

Specified by:
delVote in interface Clan
Parameters:
CV - the clanvote object to remove
See Also:
Clan.ClanVote

recordClanKill

public void recordClanKill(MOB killer,
                           MOB killed)
Description copied from interface: Clan
Called when a member of this clan kills a member of another Will update the clan in the database.

Specified by:
recordClanKill in interface Clan
Parameters:
killer - the member of this clan that did the killing
killed - the mob or member of other clan killed

getCurrentClanKills

public int getCurrentClanKills(MOB killer)
Description copied from interface: Clan
Returns the number of other-clan kills this clan has recorded.

Specified by:
getCurrentClanKills in interface Clan
Parameters:
killer - the member of this clan that did the killing or NULL for all
Returns:
the number of kills.

getCurrentClanGoldDonations

public double getCurrentClanGoldDonations(MOB killer)
Description copied from interface: Clan
Returns the amount of base gold value this clan has received.

Specified by:
getCurrentClanGoldDonations in interface Clan
Parameters:
killer - the member of this clan that did the killing or NULL for all
Returns:
the amount of deposits.

getCurrentClanXPDonations

public long getCurrentClanXPDonations(MOB killer)
Description copied from interface: Clan
Returns the amount of xp this clan has earned.

Specified by:
getCurrentClanXPDonations in interface Clan
Parameters:
killer - the member of this clan that did the killing or NULL for all
Returns:
the number of xp contributed.

isOnlyFamilyApplicants

public boolean isOnlyFamilyApplicants()
Description copied from interface: Clan
Returns whether this clan only accepts applicants from people who are family of current members/founder.

Specified by:
isOnlyFamilyApplicants in interface Clan
Returns:
true if it is, false otherwise.

isLoyaltyThroughItems

public boolean isLoyaltyThroughItems()
Description copied from interface: Clan
Returns whether this clan attains conquest loyalty through giving out clan items.

Specified by:
isLoyaltyThroughItems in interface Clan
Returns:
true if if does, false otherwise

isWorshipConquest

public boolean isWorshipConquest()
Description copied from interface: Clan
Returns whether this clan attains conquest loyalty through mobs worshiping the same deity as their leader.

Specified by:
isWorshipConquest in interface Clan
Returns:
true if if does, false otherwise

calculateMapPoints

public long calculateMapPoints()
Description copied from interface: Clan
Returns the total control points earned by this clan

Specified by:
calculateMapPoints in interface Clan
Returns:
the number of control points represented
See Also:
Clan.calculateMapPoints(List), Clan.getControlledAreas(), Conquerable

calculateMapPoints

public long calculateMapPoints(java.util.List<Area> controlledAreas)
Description copied from interface: Clan
Returns the total control points represented by the list of controlled areas given.

Specified by:
calculateMapPoints in interface Clan
Parameters:
controlledAreas - the areas controlled
Returns:
the number of control points represented
See Also:
Clan.calculateMapPoints(), Clan.getControlledAreas(), Conquerable

getControlledAreas

public java.util.List<Area> getControlledAreas()
Description copied from interface: Clan
Returns all the areas on the map controlled by this

Specified by:
getControlledAreas in interface Clan
Returns:
a vector of area objects
See Also:
Conquerable, Area

votes

public java.util.Enumeration<Clan.ClanVote> votes()
Description copied from interface: Clan
If the clan type allows voting, this returns a series of ClanVote objects

Specified by:
votes in interface Clan
Returns:
the set of clan votes
See Also:
Clan.ClanVote

getAutoPosition

public int getAutoPosition()
Description copied from interface: Clan
Returns whether membership is automatically approved to this And if so, what the default position for members are.

Specified by:
getAutoPosition in interface Clan
Returns:
xml document describing the politics of this clan
See Also:
Clan.setAutoPosition(int)

setAutoPosition

public void setAutoPosition(int pos)
Description copied from interface: Clan
Sets whether membership is automatically approved to this And if so, what the default position for members are.

Specified by:
setAutoPosition in interface Clan
Parameters:
pos - the positition to give to applicants
See Also:
Clan.getAutoPosition()

setExp

public void setExp(long newexp)
Description copied from interface: Clan
Sets the amount of experience earned by this

Specified by:
setExp in interface Clan
Parameters:
newexp - the experience earned

adjExp

public void adjExp(MOB memberM,
                   int howMuch)
Description copied from interface: Clan
Adjusts the amount of experience earned by this

Specified by:
adjExp in interface Clan
Parameters:
memberM - member the person contributing the xp
howMuch - the experience adjustment, + or -

adjDeposit

public void adjDeposit(MOB memberM,
                       double howMuch)
Description copied from interface: Clan
Adjusts the amount of base gold value deposited by this member.

Specified by:
adjDeposit in interface Clan
Parameters:
memberM - member the person contributing
howMuch - the value adjustment, + or -

getExp

public long getExp()
Description copied from interface: Clan
Gets the amount of experience earned by this

Specified by:
getExp in interface Clan
Returns:
the experience earned

getTrophies

public int getTrophies()
Description copied from interface: Clan
Returns a bitmap representing the trophies won by this The bitmap is made up of TROPHY_* constants.

Specified by:
getTrophies in interface Clan
Returns:
a bitmap of the trophies
See Also:
Clan, Clan.setTrophies(int)

setTrophies

public void setTrophies(int trophyFlag)
Description copied from interface: Clan
Sets a bitmap representing the trophies won by this The bitmap is made up of TROPHY_* constants.

Specified by:
setTrophies in interface Clan
Parameters:
trophyFlag - a bitmap of the trophies
See Also:
Clan, Clan.getTrophies()

setTaxes

public void setTaxes(double rate)
Description copied from interface: Clan
Sets the tax rate for this

Specified by:
setTaxes in interface Clan
Parameters:
rate - the tax rate 0-100.0
See Also:
Clan.getTaxes()

getTaxes

public double getTaxes()
Description copied from interface: Clan
Gets the tax rate for this

Specified by:
getTaxes in interface Clan
Returns:
rate the tax rate 0-100.0
See Also:
Clan.setTaxes(double)

getClanRelations

public int getClanRelations(java.lang.String id)
Description copied from interface: Clan
Returns a REL_* constant denoting the relationship between this clan and the clan of the given name.

Specified by:
getClanRelations in interface Clan
Parameters:
id - the name of another
Returns:
the REL_* constant
See Also:
Clan.setClanRelations(String, int, long), Clan.getLastRelationChange(String)

getLastRelationChange

public long getLastRelationChange(java.lang.String id)
Description copied from interface: Clan
Returns the time/date stamp when this clan last changed its relations with the given

Specified by:
getLastRelationChange in interface Clan
Parameters:
id - the other clan
Returns:
when the last change was
See Also:
Clan.setClanRelations(String, int, long), Clan.getClanRelations(String)

setClanRelations

public void setClanRelations(java.lang.String id,
                             int rel,
                             long time)
Description copied from interface: Clan
Sets a new relationship between this clan and the clan with the given id.

Specified by:
setClanRelations in interface Clan
Parameters:
id - another clan
rel - the REL_* constant for the new relationship
time - a current date/time stamp for this change

getGovernmentID

public int getGovernmentID()
Description copied from interface: Clan
Returns the id representing the government type of this

Specified by:
getGovernmentID in interface Clan
Returns:
the if constant
See Also:
Clan, Clan.setGovernmentID(int), Clan.getGovernment()

setGovernmentID

public void setGovernmentID(int type)
Description copied from interface: Clan
Returns the id constant representing the government type of this

Specified by:
setGovernmentID in interface Clan
Parameters:
type - the type id constant
See Also:
Clan, Clan.getGovernmentID(), Clan.getGovernment()

getCategory

public java.lang.String getCategory()
Description copied from interface: Clan
Returns the category of the clan, which is almost always the same as the government category. This is significant since a player can only belong to N clans of a given category. See also MAXCLANS in coffeemud.ini.

Specified by:
getCategory in interface Clan
Returns:
the name of the
See Also:
Clan.setCategory(String)

getMinClanMembers

public int getMinClanMembers()
Description copied from interface: Clan
Returns the minimum clan members for the clan to become active, or to prevent being purged. A value of 0 keeps the clan alive forever

Specified by:
getMinClanMembers in interface Clan
Returns:
minimum number of clan members.

setMinClanMembers

public void setMinClanMembers(int amt)
Description copied from interface: Clan
Sets the minimum clan members for the clan to become active, or to prevent being purged. A value of 0 keeps the clan alive forever

Specified by:
setMinClanMembers in interface Clan
Parameters:
amt - the new min clan members

setCategory

public void setCategory(java.lang.String newCategory)
Description copied from interface: Clan
Sets a new category for this, which is almost always the same as the government category. This is significant since a player can only belong to N clans of a given category. See also MAXCLANS in coffeemud.ini.

Specified by:
setCategory in interface Clan
Parameters:
newCategory - the new cata of this clan
See Also:
Clan.getCategory()

isRivalrous

public boolean isRivalrous()
Description copied from interface: Clan
Returns true if this clan is rivalrous with other rivalrous clans, meaning that pvp is enabled between them, and war can be declared between them.

Specified by:
isRivalrous in interface Clan
Returns:
true or false
See Also:
Clan, Clan.setRivalrous(boolean)

setRivalrous

public void setRivalrous(boolean isRivalrous)
Description copied from interface: Clan
Set to true if this clan is rivalrous with other rivalrous clans, meaning that pvp is enabled between them, and war can be declared

Specified by:
setRivalrous in interface Clan
Parameters:
isRivalrous - true or false
See Also:
Clan, Clan.isRivalrous()

create

public void create()
Description copied from interface: Clan
Orders the system to create this clan in the database.

Specified by:
create in interface Clan

update

public void update()
Description copied from interface: Clan
Orders the system to update this clan in the database.

Specified by:
update in interface Clan

addMember

public void addMember(MOB M,
                      int role)
Description copied from interface: Clan
Adds a new member to this clan

Specified by:
addMember in interface Clan
Parameters:
M - the member to add
role - the coded role number

delMember

public void delMember(MOB M)
Description copied from interface: Clan
Del a member from this clan

Specified by:
delMember in interface Clan
Parameters:
M - the member to remove

updateClanPrivileges

public boolean updateClanPrivileges(MOB M)
Description copied from interface: Clan
This method is called when a given mobs clan status changes, for instance if they are added to the clan, removed from it, or change their rank.

Specified by:
updateClanPrivileges in interface Clan
Parameters:
M - the mob whose status needs updating
Returns:
whether the update succeeded

destroyClan

public void destroyClan()
Description copied from interface: Clan
Orders the system to destroy this clan in the database.

Specified by:
destroyClan in interface Clan

getClanClassC

protected CharClass getClanClassC()

getDetail

public java.lang.String getDetail(MOB mob)
Description copied from interface: Clan
Creates the string for the 'clandetail' command, based on the security of the given mob who will view the details.

Specified by:
getDetail in interface Clan
Parameters:
mob - the one who will view the details
Returns:
the details view of this clan for the given mob

L

public java.lang.String L(java.lang.String str,
                          java.lang.String... xs)

getGovernmentName

public java.lang.String getGovernmentName()
Description copied from interface: Clan
Returns Clan, Republic, or another one of the clan government types.

Specified by:
getGovernmentName in interface Clan
Returns:
the clans government types
See Also:
Clan

canBeAssigned

public boolean canBeAssigned(MOB mob,
                             int role)
Description copied from interface: Clan
Returns whether the given user can be assigned the given role

Specified by:
canBeAssigned in interface Clan
Parameters:
mob - the mob to check
role - the role to check for
Returns:
true if they can, false otherwise

getAuthority

public Clan.Authority getAuthority(int roleID,
                                   Clan.Function function)
Description copied from interface: Clan
Returns whether the given roleID is allowed to perform the given function. The return value can designate that they may do it now, that they may not do it, or that it requires a vote. A return value 1 means they can do it now, 0 means it requires a vote, and -1 means they can never do it. The functions are defined in the Clan interface as FUNC_* constants.

Specified by:
getAuthority in interface Clan
Parameters:
roleID - the roleID whose priviledges to check.
function - the ClanFunction function constant to use
Returns:
the ClanPositionPower enum
See Also:
Clan, Clan.Authority

fixRequirementMask

public java.lang.String fixRequirementMask(java.lang.String oldMask)

getBasicRequirementMask

public java.lang.String getBasicRequirementMask()
Description copied from interface: Clan
Returns the inner (government usually) requirements to even apply to this clan

Specified by:
getBasicRequirementMask in interface Clan
Returns:
the zapper mask that applies

getRealMemberList

protected java.util.List<Clan.MemberRecord> getRealMemberList(int PosFilter)

getSize

public int getSize()
Description copied from interface: Clan
Returns the number of members of this

Specified by:
getSize in interface Clan
Returns:
the membership count.

name

public java.lang.String name()
Description copied from interface: Tickable
The nice displayable name of this instance of this object

Specified by:
name in interface CMObject
Specified by:
name in interface Tickable
Returns:
the displayable name of this object instance
See Also:
Environmental.Name()

getName

public java.lang.String getName()
Description copied from interface: Clan
Returns the name of the clan, which is almost always the same as the ID, which is why clans can't change their names.

Specified by:
getName in interface Clan
Returns:
the name of the
See Also:
Clan.setName(String)

clanID

public java.lang.String clanID()
Description copied from interface: Clan
Returns the unique identifying ID of the clan for reference elsewhere.

Specified by:
clanID in interface Clan
Returns:
the unique identifier of the
See Also:
Clan.getName()

setName

public void setName(java.lang.String newName)
Description copied from interface: Clan
Sets a new name for this

Specified by:
setName in interface Clan
Parameters:
newName - the new name of this clan
See Also:
Clan.getName(), Clan.clanID()

getPremise

public java.lang.String getPremise()
Description copied from interface: Clan
Retrieves this Clan's basic story. This is to make the Clan's more RP based and so we can provide up-to-date information on Clans on the web server.

Specified by:
getPremise in interface Clan
Returns:
the story of this clan
See Also:
Clan.setPremise(String)

setPremise

public void setPremise(java.lang.String newPremise)
Description copied from interface: Clan
Sets this Clan's basic story.

Specified by:
setPremise in interface Clan
Parameters:
newPremise - the new premise text
See Also:
Clan.getPremise()

getClanLevel

public int getClanLevel()
Description copied from interface: Clan
Returns the current clan level

Specified by:
getClanLevel in interface Clan
Returns:
the current clan level
See Also:
Clan.setClanLevel(int)

setClanLevel

public void setClanLevel(int newClanLevel)
Description copied from interface: Clan
Sets the new clan level

Specified by:
setClanLevel in interface Clan
Parameters:
newClanLevel - the new clan level
See Also:
Clan.getClanLevel()

getAcceptanceSettings

public java.lang.String getAcceptanceSettings()
Description copied from interface: Clan
Returns a mask used to identify whether a player is allowed to join a particular

Specified by:
getAcceptanceSettings in interface Clan
Returns:
the mask used to identify prospects
See Also:
MaskingLibrary, Clan.setAcceptanceSettings(String)

setAcceptanceSettings

public void setAcceptanceSettings(java.lang.String newSettings)
Description copied from interface: Clan
Sets a mask used to identify whether a player is allowed to join a particular

Specified by:
setAcceptanceSettings in interface Clan
Parameters:
newSettings - the mask used to identify prospects
See Also:
MaskingLibrary, Clan.getAcceptanceSettings()

getClanClass

public java.lang.String getClanClass()
Description copied from interface: Clan
Retrieves this Clan's enforced character class. All players who join this clan become this class.

Specified by:
getClanClass in interface Clan
Returns:
the class of this clan
See Also:
Clan.setClanClass(String)

setClanClass

public void setClanClass(java.lang.String newClass)
Description copied from interface: Clan
Sets this Clan's enforced character class.

Specified by:
setClanClass in interface Clan
Parameters:
newClass - the new enforced character class
See Also:
Clan.getClanClass()

getPolitics

public java.lang.String getPolitics()
Description copied from interface: Clan
Returns an XML string used to identify the political relations between this clan and others.

Specified by:
getPolitics in interface Clan
Returns:
xml document describing the politics of this clan
See Also:
Clan.setPolitics(String)

setPolitics

public void setPolitics(java.lang.String politics)
Description copied from interface: Clan
Sets an XML string used to identify the political relations between this clan and others.

Specified by:
setPolitics in interface Clan
Parameters:
politics - xml document describing the politics of this clan
See Also:
Clan.getPolitics()

getStatus

public int getStatus()
Description copied from interface: Clan
Returns one of the CLANSTAT_* constants describing the pending status of this clan for acceptable, or whether its one its way out.

Specified by:
getStatus in interface Clan
Returns:
a CLANSTAT_* constant
See Also:
Clan, Clan.setStatus(int)

setStatus

public void setStatus(int newStatus)
Description copied from interface: Clan
Sets one of the CLANSTAT_* constants describing the pending status of this clan for acceptable, or whether its one its way out.

Specified by:
setStatus in interface Clan
Parameters:
newStatus - a CLANSTAT_* constant
See Also:
Clan, Clan.getStatus()

getRecall

public java.lang.String getRecall()
Description copied from interface: Clan
Returns the roomID of this clans recall room (their clan home)

Specified by:
getRecall in interface Clan
Returns:
the roomid of this clans clan home
See Also:
Clan.setRecall(String)

setRecall

public void setRecall(java.lang.String newRecall)
Description copied from interface: Clan
Sets the roomID of this clans recall room (their clan home)

Specified by:
setRecall in interface Clan
Parameters:
newRecall - the roomid of this clans clan home
See Also:
Clan.getRecall()

getMorgue

public java.lang.String getMorgue()
Description copied from interface: Clan
Returns the roomID of this clans morgue room

Specified by:
getMorgue in interface Clan
Returns:
the roomID of this clans morgue room
See Also:
Clan.setMorgue(String)

setMorgue

public void setMorgue(java.lang.String newMorgue)
Description copied from interface: Clan
Sets the roomID of this clans morgue room

Specified by:
setMorgue in interface Clan
Parameters:
newMorgue - the roomID of this clans morgue room
See Also:
Clan.getMorgue()

getDonation

public java.lang.String getDonation()
Description copied from interface: Clan
Returns the roomID of this clans donation room

Specified by:
getDonation in interface Clan
Returns:
the roomID of this clans donation room
See Also:
Clan.setDonation(String)

setDonation

public void setDonation(java.lang.String newDonation)
Description copied from interface: Clan
Sets the roomID of this clans donation room

Specified by:
setDonation in interface Clan
Parameters:
newDonation - the roomID of this clans donation room
See Also:
Clan.getDonation()

getMemberList

public java.util.List<Clan.MemberRecord> getMemberList()
Description copied from interface: Clan
Returns the set of members, where each row represents a MemberRecord

Specified by:
getMemberList in interface Clan
Returns:
the membership
See Also:
Clan.getMemberList(int), Clan.getFullMemberList(), Clan.MemberRecord

filterMedianLevel

public int filterMedianLevel(java.util.List<Clan.FullMemberRecord> members)

filterMemberList

public java.util.List<Clan.MemberRecord> filterMemberList(java.util.List<? extends Clan.MemberRecord> members,
                                                          int posFilter)

getMemberList

public java.util.List<Clan.MemberRecord> getMemberList(int posFilter)
Description copied from interface: Clan
Returns the set of members, where each row represents a MemberRecord. Will filter by the given POS_* constant.

Specified by:
getMemberList in interface Clan
Parameters:
posFilter - the position filter
Returns:
the membership
See Also:
Clan, Clan.MemberRecord

findMemberRecord

public Clan.MemberRecord findMemberRecord(java.lang.String name)
Description copied from interface: Clan
Returns the named member, if possible

Specified by:
findMemberRecord in interface Clan
Parameters:
name - the name of the member
Returns:
the member record
See Also:
Clan.getMemberList(int), Clan.getFullMemberList(), Clan.MemberRecord

findMember

public MOB findMember(java.lang.String name)
Description copied from interface: Clan
Returns the named member, if possible

Specified by:
findMember in interface Clan
Parameters:
name - the name of the member
Returns:
the member mob
See Also:
Clan.getMemberList(int), Clan.getFullMemberList(), Clan.MemberRecord

getMember

public Clan.MemberRecord getMember(java.lang.String name)

getFullMemberList

public java.util.List<Clan.FullMemberRecord> getFullMemberList()
Description copied from interface: Clan
Returns the set of members, where each row represents a FullMemberRecord

Specified by:
getFullMemberList in interface Clan
Returns:
the membership
See Also:
Clan.getMemberList(), Clan.FullMemberRecord

getNumVoters

public int getNumVoters(Clan.Function function)
Description copied from interface: Clan
Returns the number of members allowed to vote on the given function. The function is one of the FUNC_* constants.

Specified by:
getNumVoters in interface Clan
Parameters:
function - the FUNC_* constant
Returns:
the number of members of this clan who can vote on it
See Also:
Clan

getTopRankedRoles

public java.util.List<java.lang.Integer> getTopRankedRoles(Clan.Function func)
Description copied from interface: Clan
Returns the roleid(s) constant representing the highest rank roleid(s) in this clan type that can perform the given function.

Specified by:
getTopRankedRoles in interface Clan
Parameters:
func - the function to perform, or null just to return privileged rank
Returns:
the top roleid
See Also:
ClanPosition, Clan.Function

getNumberRoles

public int getNumberRoles()
Description copied from interface: Clan
Returns the number of roles (max roleid)

Specified by:
getNumberRoles in interface Clan
Returns:
number of roles

getTopQualifiedRoleID

public int getTopQualifiedRoleID(Clan.Function func,
                                 MOB mob)
Description copied from interface: Clan
Returns the roleid constant representing the highest rank in this clan type that can perform the given function or null.

Specified by:
getTopQualifiedRoleID in interface Clan
Parameters:
func - the function (or null) they must be able to do
mob - the mob to check for a top rank
Returns:
the roleid constant
See Also:
ClanPosition, Clan.Function

getRoleFromName

public int getRoleFromName(java.lang.String position)
Description copied from interface: Clan
For the clan government type, this function will return the clan role that most closely matches the given string "position". It will return -1 if no position is found that matches the string. The returned value will an an official role bitmask.

Specified by:
getRoleFromName in interface Clan
Parameters:
position - the name of the position to look for
Returns:
the role mask/code number for this government, oe -1

isPubliclyListedFor

public boolean isPubliclyListedFor(MOB mob)
Description copied from interface: Clan
Returns whether this clan gets listed with the clanlist command. Does not affect clanlog messaging.

Specified by:
isPubliclyListedFor in interface Clan
Parameters:
mob - the person viewing
Returns:
true if it is, false otherwise.

getRolesList

public java.lang.String[] getRolesList()
Description copied from interface: Clan
Returns the list of roles for people in this clan, from lowest rank to the highest. Must correspond with roleIDs

Specified by:
getRolesList in interface Clan
Returns:
the role list

getMostInRole

public int getMostInRole(int roleID)
Description copied from interface: Clan
Returns the maximum number of players who can hold the given role in this For assignment purposes.

Specified by:
getMostInRole in interface Clan
Parameters:
roleID - the role to get a max for
Returns:
the max

getRoleName

public java.lang.String getRoleName(int roleID,
                                    boolean titleCase,
                                    boolean plural)
Description copied from interface: Clan
Returns the friendly descriptive name of a given role in a clan, based on very specific criteria.

Specified by:
getRoleName in interface Clan
Parameters:
roleID - the role code of the role to describe
titleCase - whether or not to uppercase the first word
plural - whether or not to return the word as a plural
Returns:
the friendly descriptive name of a given role in a clan

isSafeFromPurge

protected boolean isSafeFromPurge()

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

doesOutRank

public boolean doesOutRank(int highRoleID,
                           int lowRoleID)
Description copied from interface: Clan
Returns whether the high role id outranks the low roldid

Specified by:
doesOutRank in interface Clan
Parameters:
highRoleID - first
lowRoleID - second
Returns:
true if highRoleiD outranks lowRoleID

clanAnnounce

public void clanAnnounce(java.lang.String msg)
Description copied from interface: Clan
Sends a message to all members of all clans.

Specified by:
clanAnnounce in interface Clan
Parameters:
msg - the message to send

clanAbilities

public SearchIDList<Ability> clanAbilities(MOB mob)
Description copied from interface: Clan
Return a vector of skills, spells, and other abilities granted to the given mob of the given mobs level.

Specified by:
clanAbilities in interface Clan
Parameters:
mob - the mob to grant the abilities to
Returns:
a vector of the Ability objects
See Also:
Ability

numClanEffects

public int numClanEffects(MOB mob)
Description copied from interface: Clan
Return size of a vector of skills, spells, and other effects granted to the given mob of the given mobs level. Much more efficient than getting the whole list and checking its size.

Specified by:
numClanEffects in interface Clan
Parameters:
mob - the mob to grant the abilities to
Returns:
a size of a vector of the Ability objects
See Also:
Ability

clanEffects

public ChameleonList<Ability> clanEffects(MOB mob)
Description copied from interface: Clan
Return a vector of skills, spells, and other effects granted to the given mob of the given mobs level.

Specified by:
clanEffects in interface Clan
Parameters:
mob - the mob to grant the abilities to
Returns:
a vector of the Ability objects
See Also:
Ability

applyExpMods

public int applyExpMods(MOB memberM,
                        int exp)
Description copied from interface: Clan
Adjusts the amount of experience earned by a player based on the tax rate. Will automatically adjust the exp of the clan and save it.

Specified by:
applyExpMods in interface Clan
Parameters:
memberM - member the person contributing the xp
exp - the old experience
Returns:
the exp adjusted by the clan, if at all.

getResponsibleMember

public MOB getResponsibleMember()
Description copied from interface: Clan
Returns the highest ranking member of this

Specified by:
getResponsibleMember in interface Clan
Returns:
the mob object for the highest ranking member.

getExtItems

public ItemCollection getExtItems()
Description copied from interface: Clan
Gets external items belonging to this clan, which should be destroyed with the clan, but can still be transient. These are items like artifacts, or ships, vehicles, etc.

Specified by:
getExtItems in interface Clan
Returns:
an item collection
See Also:
ItemCollection, Item

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: Modifiable
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.

Specified by:
getStatCodes in interface Modifiable
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

getSaveStatIndex

public int getSaveStatIndex()
Description copied from interface: Modifiable
Returns the index into the stat codes array where extra savable fields begins. This number is always the same as getStatCodes().length unless there are extra fields which need to be saved in xml for generic objects. This method is used by editors for post-build user-defined fields.

Specified by:
getSaveStatIndex in interface Modifiable
Returns:
the index into getStatCodes()
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String), Modifiable.setStat(String, String)

isStat

public boolean isStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
isStat in interface Modifiable
Parameters:
code - the name of the field to read.
Returns:
true if the code is a real value, false otherwise
See Also:
Modifiable.getStatCodes()

getStat

public java.lang.String getStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
getStat in interface Modifiable
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
See Also:
Modifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: Modifiable
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. The value passed in is always a string, even if the field itself is numeric or a list.

Specified by:
setStat in interface Modifiable
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()