|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Common.DefaultClan
public class DefaultClan
Portions Copyright (c) 2003 Jeremy Vyska
Portions Copyright (c) 2004-2008 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.ClanVote |
| Field Summary | |
|---|---|
protected java.lang.String |
AcceptanceSettings
|
protected int |
autoPosition
|
protected java.lang.String |
clanClass
|
protected java.lang.String |
clanDonationRoom
|
protected java.util.Vector |
clanKills
|
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 int |
clanType
|
protected long |
exp
|
int |
government
|
protected java.lang.String |
lastClanKillRecord
|
java.util.Hashtable |
relations
|
protected double |
taxRate
|
protected java.util.Vector |
voteList
|
| Constructor Summary | |
|---|---|
DefaultClan()
|
|
| Method Summary | |
|---|---|
void |
addMember(MOB M,
int role)
Adds a new member to this clan |
void |
addVote(java.lang.Object CV)
Adds a new ClanVote object to the list of ongoing votes for this clan. |
void |
adjExp(int howMuch)
Adjusts the amount of experience earned by this clan. |
int |
allowedToDoThis(MOB mob,
int function)
Returns whether the given mob is allowed to perform the given function. |
int |
applyExpMods(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.Vector controlledAreas)
Returns the total control points represented by the list of controlled areas given. |
boolean |
canBeAssigned(MOB mob,
int role)
|
void |
clanAnnounce(java.lang.String msg)
Sends a message to all members of all clans. |
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(java.lang.Object CV)
Removes a new ClanVote object from the list of ongoing votes for this clan. |
void |
destroyClan()
Orders the system to destroy this clan in the database. |
java.lang.String |
getAcceptanceSettings()
Returns a mask used to identify whether a player is allowed to join a particular clan. |
int |
getAutoPosition()
Returns whether membership is automatically approved to this clan. |
java.lang.String |
getClanClass()
Retrieves this Clan's enforced character class. |
protected CharClass |
getClanClassC()
|
int |
getClanRelations(java.lang.String id)
Returns a Clan.REL_* constant denoting the relationship between this clan and the clan of the given name. |
java.util.Vector |
getControlledAreas()
Returns all the areas on the map controlled by this clan. |
int |
getCurrentClanKills()
Returns the number of other-clan kills this clan has recorded. |
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 clan. |
int |
getGovernment()
Returns the Clan.GVT_* constant representing the government type of this clan. |
long |
getLastRelationChange(java.lang.String id)
Returns the time/date stamp when this clan last changed its relations with the given clan. |
DVector |
getMemberList()
Returns the set of members, where each row represents a member, and the columns are name, role, last login date |
DVector |
getMemberList(int PosFilter)
Returns the set of members, where each row represents a member, and the columns are name, role, last login date. |
java.lang.String |
getMorgue()
Returns the roomID of this clans morgue room |
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 |
getNumVoters(int 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. |
DVector |
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 clan. |
int |
getSaveStatIndex()
Returns the index into the stat codes array where extra savable fields begins. |
int |
getSize()
Returns the number of members of this clan. |
int |
getSize(java.util.Vector members)
|
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 clan. |
long |
getTickStatus()
A coded status for this object during the period where its tick method is being called. |
int |
getTopRank(MOB mob)
Returns the Clan.POS_* constant representing the highest rank in this clan type. |
int |
getTrophies()
Returns a bitmap representing the trophies won by this clan. |
int |
getType()
Returns the clan type, a meaningless variable. |
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 |
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. |
java.lang.String |
name()
The nice displayable name of this instance of this object |
CMObject |
newInstance()
return a new instance of the object |
void |
recordClanKill()
Called when a member of this clan kills a member of another clan. |
void |
setAcceptanceSettings(java.lang.String newSettings)
Sets a mask used to identify whether a player is allowed to join a particular clan. |
void |
setAutoPosition(int pos)
Sets whether membership is automatically approved to this clan. |
void |
setClanClass(java.lang.String newClass)
Sets this Clan's enforced character class. |
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 clan. |
void |
setGovernment(int type)
Returns the Clan.GVT_* constant representing the government type of this clan. |
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 clan. |
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 |
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 clan. |
void |
setTrophies(int trophyFlag)
Sets a bitmap representing the trophies won by this clan. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
java.lang.String |
typeName()
Returns Clan, Republic, or another one of the clan government types defined by Clan.GVT_DESC |
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 clan. |
java.util.Enumeration |
votes()
If the clan type allows voting, this returns a series of Clan.ClanVote objects |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String clanName
protected java.lang.String clanPremise
protected java.lang.String clanRecall
protected java.lang.String clanMorgue
protected java.lang.String clanClass
protected java.lang.String clanDonationRoom
protected int clanTrophies
protected int autoPosition
protected java.lang.String AcceptanceSettings
protected int clanType
protected int ClanStatus
protected java.util.Vector voteList
protected long exp
protected java.util.Vector clanKills
protected java.lang.String lastClanKillRecord
protected double taxRate
public java.util.Hashtable relations
public int government
| Constructor Detail |
|---|
public DefaultClan()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectpublic long getTickStatus()
Tickable
getTickStatus in interface TickableTickable.tick(Tickable, int)public CMObject newInstance()
newInstance in interface CMObjectpublic void initializeClass()
CMObject
initializeClass in interface CMObjectpublic int compareTo(CMObject o)
compareTo in interface java.lang.Comparable<CMObject>public CMObject copyOf()
CMObject
copyOf in interface CMObjectpublic void updateVotes()
Clan
updateVotes in interface Clanpublic void addVote(java.lang.Object CV)
Clan
addVote in interface ClanCV - the clanvote object to addClan.ClanVotepublic void delVote(java.lang.Object CV)
Clan
delVote in interface ClanCV - the clanvote object to removeClan.ClanVotepublic void recordClanKill()
Clan
recordClanKill in interface Clanpublic int getCurrentClanKills()
Clan
getCurrentClanKills in interface Clanpublic long calculateMapPoints()
Clan
calculateMapPoints in interface ClanClan.calculateMapPoints(Vector),
Clan.getControlledAreas(),
Conquerablepublic long calculateMapPoints(java.util.Vector controlledAreas)
Clan
calculateMapPoints in interface ClancontrolledAreas - the areas controlled
Clan.calculateMapPoints(),
Clan.getControlledAreas(),
Conquerablepublic java.util.Vector getControlledAreas()
Clan
getControlledAreas in interface ClanConquerable,
Areapublic java.util.Enumeration votes()
Clan
votes in interface ClanClan.ClanVotepublic int getAutoPosition()
Clan
getAutoPosition in interface ClanClan.setAutoPosition(int)public void setAutoPosition(int pos)
Clan
setAutoPosition in interface Clanpos - the positition to give to applicantsClan.getAutoPosition()public long getExp()
Clan
getExp in interface Clanpublic void setExp(long newexp)
Clan
setExp in interface Clannewexp - the experience earnedpublic void adjExp(int howMuch)
Clan
adjExp in interface ClanhowMuch - the experience adjustment, + or -public int getTrophies()
Clan
getTrophies in interface ClanClan,
Clan.setTrophies(int)public void setTrophies(int trophyFlag)
Clan
setTrophies in interface ClantrophyFlag - a bitmap of the trophiesClan,
Clan.getTrophies()public void setTaxes(double rate)
Clan
setTaxes in interface Clanrate - the tax rate 0-100.0Clan.getTaxes()public double getTaxes()
Clan
getTaxes in interface ClanClan.setTaxes(double)public int getClanRelations(java.lang.String id)
Clan
getClanRelations in interface Clanid - the name of another clan.
Clan.setClanRelations(String, int, long),
Clan.getLastRelationChange(String)public long getLastRelationChange(java.lang.String id)
Clan
getLastRelationChange in interface Clanid - the other clan
Clan.setClanRelations(String, int, long),
Clan.getClanRelations(String)
public void setClanRelations(java.lang.String id,
int rel,
long time)
Clan
setClanRelations in interface Clanid - another clanrel - the Clan.REL_* constant for the new relationshiptime - a current date/time stamp for this changepublic int getGovernment()
Clan
getGovernment in interface ClanClan,
Clan.setGovernment(int)public void setGovernment(int type)
Clan
setGovernment in interface Clantype - the Clan.GVT_* constantClan,
Clan.getGovernment()public void create()
Clan
create in interface Clanpublic void update()
Clan
update in interface Clan
public void addMember(MOB M,
int role)
Clan
addMember in interface ClanM - the member to addrole - the coded role numberpublic void delMember(MOB M)
Clan
delMember in interface ClanM - the member to removepublic boolean updateClanPrivileges(MOB M)
Clan
updateClanPrivileges in interface ClanM - the mob whose status needs updating
public void destroyClan()
Clan
destroyClan in interface Clanprotected CharClass getClanClassC()
public java.lang.String getDetail(MOB mob)
Clan
getDetail in interface Clanmob - the one who will view the details
public java.lang.String typeName()
Clan
typeName in interface ClanClan
public boolean canBeAssigned(MOB mob,
int role)
canBeAssigned in interface Clan
public int allowedToDoThis(MOB mob,
int function)
Clan
allowedToDoThis in interface Clanmob - the mob whose priviledges to check.function - the Clan.FUNC_* constant to use
Clanpublic DVector getRealMemberList(int PosFilter)
public int getSize()
Clan
getSize in interface Clanpublic int getSize(java.util.Vector members)
public java.lang.String name()
Tickable
name in interface Tickablepublic java.lang.String getName()
Clan
getName in interface ClanClan.setName(String)public java.lang.String clanID()
Clan
clanID in interface ClanClan.getName()public void setName(java.lang.String newName)
Clan
setName in interface ClannewName - the new name of this clanClan.getName(),
Clan.clanID()public int getType()
Clan
getType in interface Clanpublic java.lang.String getPremise()
Clan
getPremise in interface ClanClan.setPremise(String)public void setPremise(java.lang.String newPremise)
Clan
setPremise in interface ClanClan.getPremise()public java.lang.String getAcceptanceSettings()
Clan
getAcceptanceSettings in interface ClanMaskingLibrary,
Clan.setAcceptanceSettings(String)public void setAcceptanceSettings(java.lang.String newSettings)
Clan
setAcceptanceSettings in interface ClannewSettings - the mask used to identify prospectsMaskingLibrary,
Clan.getAcceptanceSettings()public java.lang.String getClanClass()
Clan
getClanClass in interface ClanClan.setClanClass(String)public void setClanClass(java.lang.String newClass)
Clan
setClanClass in interface ClanClan.getClanClass()public java.lang.String getPolitics()
Clan
getPolitics in interface ClanClan.setPolitics(String)public void setPolitics(java.lang.String politics)
Clan
setPolitics in interface Clanpolitics - xml document describing the politics of this clanClan.getPolitics()public int getStatus()
Clan
getStatus in interface ClanClan,
Clan.setStatus(int)public void setStatus(int newStatus)
Clan
setStatus in interface ClannewStatus - a Clan.CLANSTAT_* constantClan,
Clan.getStatus()public java.lang.String getRecall()
Clan
getRecall in interface ClanClan.setRecall(String)public void setRecall(java.lang.String newRecall)
Clan
setRecall in interface ClannewRecall - the roomid of this clans clan homeClan.getRecall()public java.lang.String getMorgue()
Clan
getMorgue in interface ClanClan.setMorgue(String)public void setMorgue(java.lang.String newMorgue)
Clan
setMorgue in interface ClannewMorgue - the roomID of this clans morgue roomClan.getMorgue()public java.lang.String getDonation()