com.planet_ink.coffee_mud.Libraries.interfaces
Interface ClanManager

All Superinterfaces:
java.lang.Cloneable, CMLibrary, CMObject, java.lang.Comparable<CMObject>
All Known Implementing Classes:
Clans

public interface ClanManager
extends CMLibrary


Method Summary
 void addClan(Clan C)
          Adds the given clan to the games list
 boolean authCheck(java.lang.String clanID, int roleID, Clan.Function function)
          If the clan exists, it will check to see if the given role is allowed (or at least not disallowed) from the given clan function
 void clanAnnounce(MOB mob, java.lang.String msg)
          Makes an announcement to the clan announcement channel from the given mob.
 void clanAnnounceAll(java.lang.String msg)
          Sends a message to the games official CLAN chat channel.
 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.
 ClanGovernment createGovernment(java.lang.String name)
          Creates the new stock government
 ClanGovernment createSampleGovernment()
          Creates, but does not add, a sample government object
 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.
 Clan getClan(java.lang.String id)
          Returns the Clan object associated with the given clan name
 int getClanRelations(java.lang.String clanName1, java.lang.String clanName2)
          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, boolean exact)
          Returns help on the government type named, if it is available
 long getLastGovernmentLoad()
          Get last time governments were loaded/updated
 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.
 boolean goForward(MOB mob, Clan C, java.util.Vector commands, Clan.Function function, boolean voteIfNecessary)
          Examines the given command string, which is based on the given clan function code.
 boolean isCommonClanRelations(java.lang.String clanName1, java.lang.String clanName2, 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.
 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 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.
 void tickAllClans()
          Forces all clans to go through their maintenance process, which normally only occurs infrequently.
 java.lang.String translatePrize(int trophy)
          Returns a descriptive name for the given trophy code number.
 boolean trophySystemActive()
          Returns whether this mud has activated its trophy system for clans.
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
activate, getSupportThread, propertiesLoaded, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

clansNames

java.util.Enumeration<java.lang.String> clansNames()
Returns a list of all available clans names in the game, as Clan objects.

Returns:
a list of all available clans names in the game,
See Also:
Clan

numClans

int numClans()
Returns the number of clans in the game.

Returns:
the number of clans in the game.

isCommonClanRelations

boolean isCommonClanRelations(java.lang.String clanName1,
                              java.lang.String clanName2,
                              int relation)
This method is used to determine the basic relationship between two clans. The two clans are evaluated, based on their declared relationship to each other, and the relations they inherit from allys. It is then compared with the passed in relationship constant. If they match, true is returned, and false otherwise.

Parameters:
clanName1 - the first clan to evaluate
clanName2 - the second clan to evaluate
relation - the clan relation to compare to
Returns:
true if the common relationship matches the given relation, and false otherwise
See Also:
Clan.REL_DESCS

getClanRelations

int getClanRelations(java.lang.String clanName1,
                     java.lang.String clanName2)
This method is used to determine the basic relationship between two clans. The two clans are evaluated, based on their declared relationship to each other, and the relations they inherit from allys. This relationship is then returned as a relation constant number.

Parameters:
clanName1 - the first clan to evaluate
clanName2 - the second clan to evaluate
Returns:
the relation code integer
See Also:
Clan.REL_DESCS

getLastGovernmentLoad

long getLastGovernmentLoad()
Get last time governments were loaded/updated

Returns:
time in ms

getClan

Clan getClan(java.lang.String id)
Returns the Clan object associated with the given clan name

Parameters:
id - the clan name
Returns:
the Clan object associated with the given clan name
See Also:
Clan

findClan

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.

Parameters:
id -
Returns:
the Clan object associated with the given clan name
See Also:
Clan

clans

java.util.Enumeration<Clan> clans()
Returns an enumeration of all the Clans in the game

Returns:
an enumeration of all the Clans in the game

addClan

void addClan(Clan C)
Adds the given clan to the games list

Parameters:
C - the clan to add

removeClan

void removeClan(Clan C)
Removes the given clan from the games list

Parameters:
C - the clan to remove

tickAllClans

void tickAllClans()
Forces all clans to go through their maintenance process, which normally only occurs infrequently. This does things like handle automatic promotions, manage votes, and clean out inactive clans.


clanAnnounceAll

void clanAnnounceAll(java.lang.String msg)
Sends a message to the games official CLAN chat channel. This is normally for messages that may interest all clans.

Parameters:
msg - the message to send

authCheck

boolean authCheck(java.lang.String clanID,
                  int roleID,
                  Clan.Function function)
If the clan exists, it will check to see if the given role is allowed (or at least not disallowed) from the given clan function

Parameters:
clanID - the clan name
roleID - the clan roleID
function - the clan function
Returns:
true if they aren't disallowed, false otherwise
See Also:
Clan

translatePrize

java.lang.String translatePrize(int trophy)
Returns a descriptive name for the given trophy code number.

Parameters:
trophy - the trophy code number
Returns:
the descriptive name
See Also:
Clan.TROPHY_DESCS

trophySystemActive

boolean trophySystemActive()
Returns whether this mud has activated its trophy system for clans.

Returns:
whether this mud has activated its trophy system for clans.

isFamilyOfMembership

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.

Parameters:
M - the mob to evaluate
members - the members of a clan
Returns:
true if the mob is a family member, and false otherwise

getGovernmentHelp

java.lang.String getGovernmentHelp(MOB mob,
                                   java.lang.String named,
                                   boolean exact)
Returns help on the government type named, if it is available

Parameters:
mob - the viewer of the government type
named - the possible name of the government
exact - true to only match exact, or false otherwise
Returns:
null, or the help for the government named

getStockGovernment

ClanGovernment getStockGovernment(int typeid)
Returns a government definition object of the given internal stock clangovernments.xml id. See /resources/clangovernments.xml Also:

Parameters:
typeid - the internal typeid
Returns:
the clan government object
See Also:
ClanGovernment

getDefaultGovernment

ClanGovernment getDefaultGovernment()
Returns the default government definition object. See /resources/clangovernments.xml Also:

Returns:
the clan government object
See Also:
ClanGovernment

createSampleGovernment

ClanGovernment createSampleGovernment()
Creates, but does not add, a sample government object

Returns:
a sample government object

getStockGovernments

ClanGovernment[] getStockGovernments()
Returns all government definition objects from internal stock clangovernments.xml file. See /resources/clangovernments.xml Also:

Returns:
the clan government object
See Also:
ClanGovernment

makeGovernmentXML

java.lang.String makeGovernmentXML(ClanGovernment gvt)
Converts a given clan government object into xml.

Parameters:
gvt - the clan government object
Returns:
the xml
See Also:
ClanGovernment, makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment[]), parseGovernmentXML(StringBuffer)

makeGovernmentXML

java.lang.String makeGovernmentXML(ClanGovernment[] gvts)
Converts a given clan government objects into xml.

Parameters:
gvts - the clan government objects
Returns:
the xml
See Also:
ClanGovernment, makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment), parseGovernmentXML(StringBuffer)

parseGovernmentXML

ClanGovernment[] parseGovernmentXML(java.lang.StringBuffer xml)
Converts xml into clan government objects.

Parameters:
xml - the xml
Returns:
the clan government objects
See Also:
ClanGovernment, makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment), makeGovernmentXML(com.planet_ink.coffee_mud.Common.interfaces.ClanGovernment[])

reSaveGovernmentsXML

void reSaveGovernmentsXML()
Forces the stock governments to be re-saved to clangovernments.xml.


createGovernment

ClanGovernment createGovernment(java.lang.String name)
Creates the new stock government

Parameters:
name - governmentname
Returns:
new stock government

removeGovernment

boolean removeGovernment(ClanGovernment government)
Deletes the stock government.. confusing all the clans that currently use it.

Parameters:
government - the government to delete

clanAnnounce

void clanAnnounce(MOB mob,
                  java.lang.String msg)
Makes an announcement to the clan announcement channel from the given mob. These are channels marked in the coffeemud.ini file as receiving clan info messages. These messages are only seen by the authors clan members.

Parameters:
mob - the mob who is announcing the message
msg - string message to send to the clan info channels

goForward

boolean goForward(MOB mob,
                  Clan C,
                  java.util.Vector commands,
                  Clan.Function function,
                  boolean voteIfNecessary)
Examines the given command string, which is based on the given clan function code. If the given Clan requires a vote to accomplish it, the vote will be created. If the given clan forbids the given mob from performing the given function, or from even starting a vote on it, the method will return false. If the mob is allowed to perform

Parameters:
mob - the player who wants to perform the function
C - the clan that the player belongs to
commands - the command list describing the function that wants to be executed
function - the function code described by the commands list
voteIfNecessary - true to start a vote if one is needed, false to just return true.
Returns:
true to execute the given command, and false not to.
See Also:
Clan.Function.ACCEPT