com.planet_ink.coffee_mud.Common
Class DefaultPlayerStats

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultPlayerStats
All Implemented Interfaces:
AccountStats, CMCommon, PlayerStats, CMObject, Modifiable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultPlayerStats
extends java.lang.Object
implements PlayerStats


Field Summary
protected  PlayerAccount account
           
protected  long accountExpiration
           
protected  STreeMap<java.lang.String,java.lang.String> alias
           
protected  java.lang.String announceMsg
           
protected  int[] birthday
           
protected  int channelMask
           
protected static java.lang.String[] CODES
           
protected  java.lang.String colorStr
           
protected  java.lang.String email
           
protected  SHashSet<java.lang.String> friends
           
protected static int GTELL_STACK_MAX_SIZE
           
protected  SVector<java.lang.String> gtellStack
           
protected  long hygiene
           
protected  SHashSet<java.lang.String> ignored
           
protected  SHashSet<java.lang.String> introductions
           
protected  java.lang.String lastIP
           
protected  long lastUpdated
           
protected  DVector levelInfo
           
protected  long lLastDateTime
           
protected  java.lang.String notes
           
protected  int pageBreak
           
protected  java.lang.String password
           
protected  java.lang.String poofin
           
protected  java.lang.String poofout
           
protected  java.lang.String prompt
           
protected  long replyTime
           
protected  MOB replyTo
           
protected  int replyType
           
protected  java.lang.String savedPose
           
protected  SVector<java.lang.String> securityGroups
           
protected static int TELL_STACK_MAX_SIZE
           
protected  SVector<java.lang.String> tellStack
           
protected  SVector<java.lang.String> titles
           
protected  java.lang.String tranpoofin
           
protected  java.lang.String tranpoofout
           
protected  RoomnumberSet visitedRoomSet
           
protected  int wrap
           
protected  java.lang.String[] xtraValues
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.PlayerStats
HYGIENE_COMMONDIRTY, HYGIENE_DELIMIT, HYGIENE_FIGHTDIRTY, HYGIENE_WATERCLEAN, REPLY_SAY, REPLY_TELL, REPLY_YELL
 
Constructor Summary
DefaultPlayerStats()
           
 
Method Summary
 void addAliasName(java.lang.String named)
          Adds a new alias command for this player, undefined at first.
 void addGTellStack(java.lang.String msg)
          Adds a new string message to the gtell stack.
 void addRoomVisit(Room R)
          Records the fact that this player has been to the given room.
 void addTellStack(java.lang.String msg)
          Adds a new string message to the tell stack.
 boolean adjHygiene(long byThisMuch)
          Modifies, up or down, how stinky this player is.
 java.lang.String announceMessage()
          For players with the ANNOUNCE command, this is the message used to prefix the announcements proclaimed.
 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 delAliasName(java.lang.String named)
          Removes an old alias command for this player.
 PlayerAccount getAccount()
          If the ACCOUNTSYSTEM is used, this will access the account object that is shared by all players of this account.
 long getAccountExpiration()
          If the ACCOUNT system is used, this returns the time, in milis since 1970, that this account will expire (meaning the player will no longer be able to log in)
 java.lang.String getActiveTitle()
          Returns which of the player available titles is currently being used by this player.
 java.lang.String getAlias(java.lang.String named)
          Returns the definition of the given alias command for this player.
 java.lang.String[] getAliasNames()
          Returns the string array set of defined alias commands for this player.
 java.lang.String getAliasXML()
           
 int[] getBirthday()
          Returns a 2-dimensional integer array with the players birth day and month (in mud calendar)
 int getChannelMask()
          Returns a bitmask of channels turned on/off.
protected  int getCodeNum(java.lang.String code)
           
 java.lang.String getColorStr()
          Returns a custom coded string detailing the changes to the official color code that apply to this player only.
 java.lang.String getEmail()
          Returns the players email address, if available.
 java.util.Set<java.lang.String> getFriends()
          Returns a modifiable HashSet that contains the set of player Names that constitutes this players friends.
 java.util.List<java.lang.String> getGTellStack()
          Returns a List of the last few string messages sent and received to and from this players group.
 SHashSet<java.lang.String> getHashFrom(java.lang.String str)
           
 long getHygiene()
          Returns a long value of how stinky this player is.
 java.util.Set<java.lang.String> getIgnored()
          Returns a modifiable HashSet that contains the set of player Names that constitutes this players ignored player list.
 int getPageBreak()
          Returns the page break row for this player, or 0.
protected  java.lang.String getPrivateList(java.util.Set<java.lang.String> h)
           
 java.lang.String getPrompt()
          Returns the custom prompt, an encoded string, for this player.
 java.lang.String getSavedPose()
          Gets the saved pose string for players.
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 java.util.List<java.lang.String> getSecurityGroups()
          Returns a modifiable Vector of security flags and groups strings to which this player is privileged.
protected  java.lang.String getSecurityGroupStr()
           
 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.
 java.util.List<java.lang.String> getTellStack()
          Returns a List of the last few string messages sent and received to and from this player.
 java.util.List<java.lang.String> getTitles()
          Returns a Vector of modifiable title definitions.
 java.lang.String getTitleXML()
           
 int getWrap()
          Returns the word wrap column number for this player, or 0.
 java.lang.String getXML()
          Returns an XML representation of all the data in this object, for persistant storage.
 boolean hasVisited(Area A)
          Returns whether this player has visited the given area.
 boolean hasVisited(Room R)
          Returns whether this player has visited the given room.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 int initializeBirthday(int ageHours, Race R)
          When a player is first created, this method is used to either initialize their birthday, or derive their birthday based on the number of hours they've played.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 void introduceTo(java.lang.String name)
          If the INTRODUCTIONSYSTEM is used, this notifys the system that this player has met the player of the given name.
 boolean isIntroducedTo(java.lang.String name)
          If the INTRODUCTIONSYSTEM is used, this returns true if the player has been introduced to the other player of the given name.
 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.
 long lastDateTime()
          The time, in milis since 1970, that the player last logged off.
 java.lang.String lastIP()
          The last IP address this player logged in from.
 long lastUpdated()
          The time, in milis since 1970, that the player was last saved.
 long leveledDateTime(int level)
          The time, in milis since 1970, that the player gained the given level
 CMObject newInstance()
          Returns a new instance of this class.
 java.lang.String notes()
          Returns the administrative notes entered about this player.
 java.lang.String password()
          Returns the players password.
 int percentVisited(MOB mob, Area A)
          Returns the percentage (0-100) of the given area that the given player has explored.
 java.lang.String poofIn()
          For player with the GOTO command, this is the message seen by all when the player arrives from using GOTO.
 java.lang.String poofOut()
          For player with the GOTO command, this is the message seen by all when the player leaves using GOTO.
 long replyTime()
          Returns the last time, in millis since 1970, that a player last sent this playe a private message.
 MOB replyTo()
          Returns the last MOB player who sent this player a private instant message.
 int replyType()
          Returns the type of private message last sent to this player, an encoded constant.
 boolean sameAs(PlayerStats E)
          Whether this object instance is functionally identical to the object passed in.
 void setAccount(PlayerAccount account)
          If the ACCOUNTSYSTEM is used, this will allow you to set the account object that is shared by all players of this account.
 void setAccountExpiration(long newVal)
          If the ACCOUNT system is used, this sets the time, in milis since 1970, that this account will expire (meaning the player will no longer be able to log in)
 void setAlias(java.lang.String named, java.lang.String value)
          Modifies the commands executed by an existing alias command.
 void setAnnounceMessage(java.lang.String msg)
          For players with the ANNOUNCE command, this sets the message used to prefix the announcements proclaimed.
 void setChannelMask(int newMask)
          Sets the bitmask of channels turned on/off.
 void setColorStr(java.lang.String newColors)
          Sets a custom coded string detailing the changes to the official color code that apply to this player only.
 void setEmail(java.lang.String newAdd)
          Sets the players email address, if available.
 void setHygiene(long newVal)
          Sets the number meaning how stinky this player is.
 void setLastDateTime(long C)
          Sets the time, in milis since 1970, that the player last logged off.
 void setLastIP(java.lang.String ip)
          Sets the last IP address this player logged in from.
 void setLastUpdated(long time)
          Sets the time, in milis since 1970, that the player was last saved.
 void setLeveledDateTime(int level, Room R)
          Notifies the player records that, at the moment this method was called, the player gained the given level.
 void setNotes(java.lang.String newnotes)
          Sets the administrative notes entered about this player.
 void setPageBreak(int newBreak)
          Sets the page break row for this player, or 0.
 void setPassword(java.lang.String newPassword)
          Sets the players password.
 void setPoofs(java.lang.String poofIn, java.lang.String poofOut, java.lang.String tranPoofIn, java.lang.String tranPoofOut)
          For players with either the GOTO or TRANSFER command, this will set the various messages seen when coming and going using either of those commands.
 void setPrompt(java.lang.String newPrompt)
          Sets the custom prompt, an encoded string, for this player.
 void setReplyTo(MOB mob, int replyType)
          Sets the last MOB player who sent this player a private instant message, and some information about that tell (a defined constant).
 void setSavedPose(java.lang.String msg)
          Sets the saved pose string for players.
protected  void setSecurityGroupStr(java.lang.String grps)
           
 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 setWrap(int newWrap)
          Sets the word wrap column number for this player, or 0.
 void setXML(java.lang.String str)
          Restores the data in this object from an XML document.
 java.lang.String tranPoofIn()
          For player with the TRANSFER command, this is the message seen by all when the player arrives from using TRANSFER.
 java.lang.String tranPoofOut()
          For player with the TRANSFER command, this is the message seen by all when the player leaves using TRANSFER.
 void unVisit(Area A)
          Deletes the visitation record for all rooms in the given area.
 void unVisit(Room R)
          Deletes the visitation record for the given room
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TELL_STACK_MAX_SIZE

protected static final int TELL_STACK_MAX_SIZE
See Also:
Constant Field Values

GTELL_STACK_MAX_SIZE

protected static final int GTELL_STACK_MAX_SIZE
See Also:
Constant Field Values

hygiene

protected long hygiene

xtraValues

protected java.lang.String[] xtraValues

lastIP

protected java.lang.String lastIP

lLastDateTime

protected long lLastDateTime

lastUpdated

protected long lastUpdated

channelMask

protected int channelMask

email

protected java.lang.String email

password

protected java.lang.String password

colorStr

protected java.lang.String colorStr

prompt

protected java.lang.String prompt

poofin

protected java.lang.String poofin

poofout

protected java.lang.String poofout

tranpoofin

protected java.lang.String tranpoofin

tranpoofout

protected java.lang.String tranpoofout

announceMsg

protected java.lang.String announceMsg

savedPose

protected java.lang.String savedPose

notes

protected java.lang.String notes

wrap

protected int wrap

pageBreak

protected int pageBreak

birthday

protected int[] birthday

replyTo

protected MOB replyTo

replyType

protected int replyType

replyTime

protected long replyTime

account

protected PlayerAccount account

friends

protected SHashSet<java.lang.String> friends

ignored

protected SHashSet<java.lang.String> ignored

tellStack

protected SVector<java.lang.String> tellStack

gtellStack

protected SVector<java.lang.String> gtellStack

titles

protected SVector<java.lang.String> titles

alias

protected STreeMap<java.lang.String,java.lang.String> alias

securityGroups

protected SVector<java.lang.String> securityGroups

accountExpiration

protected long accountExpiration

visitedRoomSet

protected RoomnumberSet visitedRoomSet

levelInfo

protected DVector levelInfo

introductions

protected SHashSet<java.lang.String> introductions

CODES

protected static java.lang.String[] CODES
Constructor Detail

DefaultPlayerStats

public DefaultPlayerStats()
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, MiscTech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

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()

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)

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)

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()

getCodeNum

protected int getCodeNum(java.lang.String code)

sameAs

public boolean sameAs(PlayerStats E)
Description copied from interface: PlayerStats
Whether this object instance is functionally identical to the object passed in. Works by repeatedly calling getStat on both objects and comparing the values.

Specified by:
sameAs in interface PlayerStats
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String)

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

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

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

lastIP

public java.lang.String lastIP()
Description copied from interface: AccountStats
The last IP address this player logged in from.

Specified by:
lastIP in interface AccountStats
Returns:
the last IP address this player logged in from.
See Also:
AccountStats.setLastIP(String)

setLastIP

public void setLastIP(java.lang.String ip)
Description copied from interface: AccountStats
Sets the last IP address this player logged in from.

Specified by:
setLastIP in interface AccountStats
Parameters:
ip - the last IP address this player logged in from.
See Also:
AccountStats.lastIP()

getEmail

public java.lang.String getEmail()
Description copied from interface: AccountStats
Returns the players email address, if available.

Specified by:
getEmail in interface AccountStats
Returns:
the players email address, if available.
See Also:
AccountStats.setEmail(String)

setEmail

public void setEmail(java.lang.String newAdd)
Description copied from interface: AccountStats
Sets the players email address, if available.

Specified by:
setEmail in interface AccountStats
Parameters:
newAdd - the players email address, if available.
See Also:
AccountStats.getEmail()

lastUpdated

public long lastUpdated()
Description copied from interface: PlayerStats
The time, in milis since 1970, that the player was last saved.

Specified by:
lastUpdated in interface AccountStats
Specified by:
lastUpdated in interface PlayerStats
Returns:
the time, in milis since 1970, that the player was last saved.
See Also:
PlayerStats.setLastUpdated(long)

setLastUpdated

public void setLastUpdated(long time)
Description copied from interface: PlayerStats
Sets the time, in milis since 1970, that the player was last saved.

Specified by:
setLastUpdated in interface AccountStats
Specified by:
setLastUpdated in interface PlayerStats
Parameters:
time - the time, in milis since 1970, that the player was last saved.
See Also:
PlayerStats.lastUpdated()

lastDateTime

public long lastDateTime()
Description copied from interface: AccountStats
The time, in milis since 1970, that the player last logged off.

Specified by:
lastDateTime in interface AccountStats
Returns:
time, in milis since 1970, that the player last logged off.
See Also:
AccountStats.setLastDateTime(long)

setLastDateTime

public void setLastDateTime(long C)
Description copied from interface: AccountStats
Sets the time, in milis since 1970, that the player last logged off.

Specified by:
setLastDateTime in interface AccountStats
Parameters:
C - the time, in milis since 1970, that the player last logged off.
See Also:
AccountStats.lastDateTime()

password

public java.lang.String password()
Description copied from interface: AccountStats
Returns the players password.

Specified by:
password in interface AccountStats
Returns:
the players password.
See Also:
AccountStats.setPassword(String)

setPassword

public void setPassword(java.lang.String newPassword)
Description copied from interface: AccountStats
Sets the players password.

Specified by:
setPassword in interface AccountStats
Parameters:
newPassword - the players password.
See Also:
AccountStats.password()

getWrap

public int getWrap()
Description copied from interface: PlayerStats
Returns the word wrap column number for this player, or 0.

Specified by:
getWrap in interface PlayerStats
Returns:
the word wrap column number for this player, or 0.
See Also:
PlayerStats.setWrap(int)

setWrap

public void setWrap(int newWrap)
Description copied from interface: PlayerStats
Sets the word wrap column number for this player, or 0.

Specified by:
setWrap in interface PlayerStats
Parameters:
newWrap - the word wrap column number for this player, or 0.
See Also:
PlayerStats.getWrap()

getPageBreak

public int getPageBreak()
Description copied from interface: PlayerStats
Returns the page break row for this player, or 0.

Specified by:
getPageBreak in interface PlayerStats
Returns:
the page break row for this player, or 0.
See Also:
PlayerStats.setPageBreak(int)

setPageBreak

public void setPageBreak(int newBreak)
Description copied from interface: PlayerStats
Sets the page break row for this player, or 0.

Specified by:
setPageBreak in interface PlayerStats
Parameters:
newBreak - the page break row for this player, or 0.
See Also:
PlayerStats.getPageBreak()

notes

public java.lang.String notes()
Description copied from interface: AccountStats
Returns the administrative notes entered about this player.

Specified by:
notes in interface AccountStats
Returns:
the administrative notes entered about this player.
See Also:
AccountStats.setNotes(String)

setNotes

public void setNotes(java.lang.String newnotes)
Description copied from interface: AccountStats
Sets the administrative notes entered about this player.

Specified by:
setNotes in interface AccountStats
Parameters:
newnotes - the administrative notes entered about this player.
See Also:
AccountStats.notes()

setChannelMask

public void setChannelMask(int newMask)
Description copied from interface: PlayerStats
Sets the bitmask of channels turned on/off. (32 channels supported)

Specified by:
setChannelMask in interface PlayerStats
Parameters:
newMask - the bitmask of channels turned on/off. (1=off)
See Also:
PlayerStats.setChannelMask(int)

getChannelMask

public int getChannelMask()
Description copied from interface: PlayerStats
Returns a bitmask of channels turned on/off. (32 channels supported)

Specified by:
getChannelMask in interface PlayerStats
Returns:
a bitmask of channels turned on/off. (1=off)
See Also:
PlayerStats.setChannelMask(int)

replyTo

public MOB replyTo()
Description copied from interface: PlayerStats
Returns the last MOB player who sent this player a private instant message.

Specified by:
replyTo in interface PlayerStats
Returns:
the last MOB player who sent this player a private instant message.
See Also:
PlayerStats.setReplyTo(MOB, int), PlayerStats.replyType(), PlayerStats.replyTime()

replyType

public int replyType()
Description copied from interface: PlayerStats
Returns the type of private message last sent to this player, an encoded constant.

Specified by:
replyType in interface PlayerStats
Returns:
the type of private message last sent to this player
See Also:
PlayerStats.setReplyTo(MOB, int), PlayerStats.replyTo(), PlayerStats.replyTime(), PlayerStats.REPLY_SAY, PlayerStats.REPLY_TELL, PlayerStats.REPLY_YELL

replyTime

public long replyTime()
Description copied from interface: PlayerStats
Returns the last time, in millis since 1970, that a player last sent this playe a private message.

Specified by:
replyTime in interface PlayerStats
Returns:
the last time this player got a private message
See Also:
PlayerStats.setReplyTo(MOB, int), PlayerStats.replyTo(), PlayerStats.replyType()

setReplyTo

public void setReplyTo(MOB mob,
                       int replyType)
Description copied from interface: PlayerStats
Sets the last MOB player who sent this player a private instant message, and some information about that tell (a defined constant).

Specified by:
setReplyTo in interface PlayerStats
Parameters:
mob - the last MOB player who sent this player a private instant message.
replyType - the type of
See Also:
PlayerStats.replyTo(), PlayerStats.replyType(), PlayerStats.replyTime(), PlayerStats.REPLY_SAY, PlayerStats.REPLY_TELL, PlayerStats.REPLY_YELL

setPrompt

public void setPrompt(java.lang.String newPrompt)
Description copied from interface: PlayerStats
Sets the custom prompt, an encoded string, for this player. "" means default is used.

Specified by:
setPrompt in interface PlayerStats
Parameters:
newPrompt - the custom prompt, an encoded string, or ""
See Also:
PlayerStats.getPrompt()

getColorStr

public java.lang.String getColorStr()
Description copied from interface: PlayerStats
Returns a custom coded string detailing the changes to the official color code that apply to this player only. The format is the Color Code Letter (the one after the ^ character) followed by the ansi color from the basic set, followed by a # character, repeated.

Specified by:
getColorStr in interface PlayerStats
Returns:
a custom coded color string
See Also:
PlayerStats.setColorStr(String)

setColorStr

public void setColorStr(java.lang.String newColors)
Description copied from interface: PlayerStats
Sets a custom coded string detailing the changes to the official color code that apply to this player only. The format is the Color Code Letter (the one after the ^ character) followed by the ansi color from the basic set, followed by a # character, repeated.

Specified by:
setColorStr in interface PlayerStats
Parameters:
newColors - a custom coded color string
See Also:
PlayerStats.getColorStr()

announceMessage

public java.lang.String announceMessage()
Description copied from interface: PlayerStats
For players with the ANNOUNCE command, this is the message used to prefix the announcements proclaimed.

Specified by:
announceMessage in interface PlayerStats
Returns:
prefix to announcements
See Also:
PlayerStats.setAnnounceMessage(String)

setAnnounceMessage

public void setAnnounceMessage(java.lang.String msg)
Description copied from interface: PlayerStats
For players with the ANNOUNCE command, this sets the message used to prefix the announcements proclaimed.

Specified by:
setAnnounceMessage in interface PlayerStats
Parameters:
msg - prefix to announcements
See Also:
PlayerStats.announceMessage()

getSavedPose

public java.lang.String getSavedPose()
Description copied from interface: PlayerStats
Gets the saved pose string for players.

Specified by:
getSavedPose in interface PlayerStats
Returns:
a saved pose string
See Also:
PlayerStats.setSavedPose(String)

setSavedPose

public void setSavedPose(java.lang.String msg)
Description copied from interface: PlayerStats
Sets the saved pose string for players.

Specified by:
setSavedPose in interface PlayerStats
Parameters:
msg - a saved pose string
See Also:
PlayerStats.getSavedPose()

getPrompt

public java.lang.String getPrompt()
Description copied from interface: PlayerStats
Returns the custom prompt, an encoded string, for this player. "" means default is used.

Specified by:
getPrompt in interface PlayerStats
Returns:
the custom prompt, an encoded string, or ""
See Also:
PlayerStats.setPrompt(String)

isIntroducedTo

public boolean isIntroducedTo(java.lang.String name)
Description copied from interface: PlayerStats
If the INTRODUCTIONSYSTEM is used, this returns true if the player has been introduced to the other player of the given name.

Specified by:
isIntroducedTo in interface PlayerStats
Parameters:
name - the name of the other player
Returns:
true if this player has met that one, false otherwise
See Also:
PlayerStats.introduceTo(String)

introduceTo

public void introduceTo(java.lang.String name)
Description copied from interface: PlayerStats
If the INTRODUCTIONSYSTEM is used, this notifys the system that this player has met the player of the given name.

Specified by:
introduceTo in interface PlayerStats
Parameters:
name - the player whom this player just met.
See Also:
PlayerStats.isIntroducedTo(String)

getHashFrom

public SHashSet<java.lang.String> getHashFrom(java.lang.String str)

addTellStack

public void addTellStack(java.lang.String msg)
Description copied from interface: PlayerStats
Adds a new string message to the tell stack.

Specified by:
addTellStack in interface PlayerStats
Parameters:
msg - the new message for the tell stack.
See Also:
PlayerStats.getTellStack()

getTellStack

public java.util.List<java.lang.String> getTellStack()
Description copied from interface: PlayerStats
Returns a List of the last few string messages sent and received to and from this player.

Specified by:
getTellStack in interface PlayerStats
Returns:
a List of strings, the last few tell messages
See Also:
PlayerStats.addTellStack(String)

addGTellStack

public void addGTellStack(java.lang.String msg)
Description copied from interface: PlayerStats
Adds a new string message to the gtell stack.

Specified by:
addGTellStack in interface PlayerStats
Parameters:
msg - the new message for the gtell stack.
See Also:
PlayerStats.getGTellStack()

getGTellStack

public java.util.List<java.lang.String> getGTellStack()
Description copied from interface: PlayerStats
Returns a List of the last few string messages sent and received to and from this players group.

Specified by:
getGTellStack in interface PlayerStats
Returns:
a List of strings, the last few gtell messages
See Also:
PlayerStats.addGTellStack(String)

getFriends

public java.util.Set<java.lang.String> getFriends()
Description copied from interface: AccountStats
Returns a modifiable HashSet that contains the set of player Names that constitutes this players friends.

Specified by:
getFriends in interface AccountStats
Returns:
a set of player friend names

getIgnored

public java.util.Set<java.lang.String> getIgnored()
Description copied from interface: AccountStats
Returns a modifiable HashSet that contains the set of player Names that constitutes this players ignored player list.

Specified by:
getIgnored in interface AccountStats
Returns:
a set of player ignored player list Names

getAliasNames

public java.lang.String[] getAliasNames()
Description copied from interface: PlayerStats
Returns the string array set of defined alias commands for this player.

Specified by:
getAliasNames in interface PlayerStats
Returns:
the string array set of defined alias commands.
See Also:
PlayerStats.getAlias(String), PlayerStats.addAliasName(String), PlayerStats.delAliasName(String), PlayerStats.setAlias(String, String)

getAlias

public java.lang.String getAlias(java.lang.String named)
Description copied from interface: PlayerStats
Returns the definition of the given alias command for this player.

Specified by:
getAlias in interface PlayerStats
Parameters:
named - the alias command to get the definition of
Returns:
the command(s) to execute when the command is entered.
See Also:
PlayerStats.getAliasNames(), PlayerStats.addAliasName(String), PlayerStats.delAliasName(String), PlayerStats.setAlias(String, String)

addAliasName

public void addAliasName(java.lang.String named)
Description copied from interface: PlayerStats
Adds a new alias command for this player, undefined at first.

Specified by:
addAliasName in interface PlayerStats
Parameters:
named - the name of the alias command to add
See Also:
PlayerStats.getAliasNames(), PlayerStats.getAlias(String), PlayerStats.delAliasName(String), PlayerStats.setAlias(String, String)

delAliasName

public void delAliasName(java.lang.String named)
Description copied from interface: PlayerStats
Removes an old alias command for this player.

Specified by:
delAliasName in interface PlayerStats
Parameters:
named - the name of the alias command to delete
See Also:
PlayerStats.getAliasNames(), PlayerStats.getAlias(String), PlayerStats.addAliasName(String), PlayerStats.setAlias(String, String)

setAlias

public void setAlias(java.lang.String named,
                     java.lang.String value)
Description copied from interface: PlayerStats
Modifies the commands executed by an existing alias command.

Specified by:
setAlias in interface PlayerStats
Parameters:
named - the alias command to modify
value - the new command(s) to execute
See Also:
PlayerStats.getAliasNames(), PlayerStats.getAlias(String), PlayerStats.addAliasName(String), PlayerStats.delAliasName(String)

getAliasXML

public java.lang.String getAliasXML()

getActiveTitle

public java.lang.String getActiveTitle()
Description copied from interface: PlayerStats
Returns which of the player available titles is currently being used by this player. Its a string like *, the bunny slayer

Specified by:
getActiveTitle in interface PlayerStats
Returns:
a title being used by this player
See Also:
PlayerStats.getTitles()

getTitles

public java.util.List<java.lang.String> getTitles()
Description copied from interface: PlayerStats
Returns a Vector of modifiable title definitions. These are things like *, the bunny slayer and such.

Specified by:
getTitles in interface PlayerStats
Returns:
a Vector of modifiable title definitions
See Also:
PlayerStats.getActiveTitle()

getTitleXML

public java.lang.String getTitleXML()

poofIn

public java.lang.String poofIn()
Description copied from interface: PlayerStats
For player with the GOTO command, this is the message seen by all when the player arrives from using GOTO.

Specified by:
poofIn in interface PlayerStats
Returns:
the poof-in GOTO message
See Also:
PlayerStats.poofOut(), PlayerStats.setPoofs(String, String, String, String)

poofOut

public java.lang.String poofOut()
Description copied from interface: PlayerStats
For player with the GOTO command, this is the message seen by all when the player leaves using GOTO.

Specified by:
poofOut in interface PlayerStats
Returns:
the poof-out GOTO message
See Also:
PlayerStats.poofIn(), PlayerStats.setPoofs(String, String, String, String)

tranPoofIn

public java.lang.String tranPoofIn()
Description copied from interface: PlayerStats
For player with the TRANSFER command, this is the message seen by all when the player arrives from using TRANSFER.

Specified by:
tranPoofIn in interface PlayerStats
Returns:
the poof-in TRANSFER message
See Also:
PlayerStats.tranPoofOut(), PlayerStats.setPoofs(String, String, String, String)

tranPoofOut

public java.lang.String tranPoofOut()
Description copied from interface: PlayerStats
For player with the TRANSFER command, this is the message seen by all when the player leaves using TRANSFER.

Specified by:
tranPoofOut in interface PlayerStats
Returns:
the poof-out TRANSFER message
See Also:
PlayerStats.tranPoofIn(), PlayerStats.setPoofs(String, String, String, String)

getBirthday

public int[] getBirthday()
Description copied from interface: PlayerStats
Returns a 2-dimensional integer array with the players birth day and month (in mud calendar)

Specified by:
getBirthday in interface PlayerStats
Returns:
a 2-dimensional integer array (day/month)
See Also:
PlayerStats.initializeBirthday(int, Race)

initializeBirthday

public int initializeBirthday(int ageHours,
                              Race R)
Description copied from interface: PlayerStats
When a player is first created, this method is used to either initialize their birthday, or derive their birthday based on the number of hours they've played.

Specified by:
initializeBirthday in interface PlayerStats
Parameters:
ageHours - the number of hours the player played
R - the players Race
Returns:
the players new age, in mud-years
See Also:
PlayerStats.getBirthday(), MOB.getAgeHours(), Race

getPrivateList

protected java.lang.String getPrivateList(java.util.Set<java.lang.String> h)

getXML

public java.lang.String getXML()
Description copied from interface: AccountStats
Returns an XML representation of all the data in this object, for persistant storage.

Specified by:
getXML in interface AccountStats
Returns:
an XML representation of all the data in this object
See Also:
AccountStats.setXML(String)

setXML

public void setXML(java.lang.String str)
Description copied from interface: AccountStats
Restores the data in this object from an XML document.

Specified by:
setXML in interface AccountStats
Parameters:
str - an XML representation of all the data in this object
See Also:
AccountStats.getXML()

setSecurityGroupStr

protected void setSecurityGroupStr(java.lang.String grps)

getSecurityGroupStr

protected java.lang.String getSecurityGroupStr()

getSecurityGroups

public java.util.List<java.lang.String> getSecurityGroups()
Description copied from interface: PlayerStats
Returns a modifiable Vector of security flags and groups strings to which this player is privileged.

Specified by:
getSecurityGroups in interface PlayerStats
Returns:
a Vector of security flags and groups strings

setPoofs

public void setPoofs(java.lang.String poofIn,
                     java.lang.String poofOut,
                     java.lang.String tranPoofIn,
                     java.lang.String tranPoofOut)
Description copied from interface: PlayerStats
For players with either the GOTO or TRANSFER command, this will set the various messages seen when coming and going using either of those commands.

Specified by:
setPoofs in interface PlayerStats
Parameters:
poofIn - the msg seen when entering a room using GOTO
poofOut - the msg seen when leaving a room using TRANSFER
tranPoofIn - the msg seen when entering a room using GOTO
tranPoofOut - the msg seen when leaving a room using TRANSFER
See Also:
PlayerStats.tranPoofIn(), PlayerStats.tranPoofOut(), PlayerStats.poofIn(), PlayerStats.poofOut()

getHygiene

public long getHygiene()
Description copied from interface: PlayerStats
Returns a long value of how stinky this player is.

Specified by:
getHygiene in interface PlayerStats
Returns:
how stinky this player is
See Also:
PlayerStats.adjHygiene(long), PlayerStats.setHygiene(long), PlayerStats.HYGIENE_DELIMIT

setHygiene

public void setHygiene(long newVal)
Description copied from interface: PlayerStats
Sets the number meaning how stinky this player is.

Specified by:
setHygiene in interface PlayerStats
Parameters:
newVal - how stinky this player is.
See Also:
PlayerStats.getHygiene(), PlayerStats.adjHygiene(long), PlayerStats.HYGIENE_DELIMIT

adjHygiene

public boolean adjHygiene(long byThisMuch)
Description copied from interface: PlayerStats
Modifies, up or down, how stinky this player is.

Specified by:
adjHygiene in interface PlayerStats
Parameters:
byThisMuch - an amount to adjust the stinkiness by.
Returns:
true of the amount goes past the HYGIENE_DELIMIT constant
See Also:
PlayerStats.getHygiene(), PlayerStats.setHygiene(long), PlayerStats.HYGIENE_COMMONDIRTY, PlayerStats.HYGIENE_FIGHTDIRTY, PlayerStats.HYGIENE_WATERCLEAN, PlayerStats.HYGIENE_DELIMIT

getAccountExpiration

public long getAccountExpiration()
Description copied from interface: AccountStats
If the ACCOUNT system is used, this returns the time, in milis since 1970, that this account will expire (meaning the player will no longer be able to log in)

Specified by:
getAccountExpiration in interface AccountStats
Returns:
the time, in milis, that this player expires.
See Also:
AccountStats.setAccountExpiration(long)

setAccountExpiration

public void setAccountExpiration(long newVal)
Description copied from interface: AccountStats
If the ACCOUNT system is used, this sets the time, in milis since 1970, that this account will expire (meaning the player will no longer be able to log in)

Specified by:
setAccountExpiration in interface AccountStats
Parameters:
newVal - the time, in milis, that this player expires.
See Also:
AccountStats.getAccountExpiration()

addRoomVisit

public void addRoomVisit(Room R)
Description copied from interface: PlayerStats
Records the fact that this player has been to the given room.

Specified by:
addRoomVisit in interface PlayerStats
Parameters:
R - the room to credit the player with
See Also:
PlayerStats.hasVisited(Room), PlayerStats.hasVisited(Area), PlayerStats.percentVisited(MOB, Area), PlayerStats.unVisit(Room), PlayerStats.unVisit(Area)

hasVisited

public boolean hasVisited(Room R)
Description copied from interface: PlayerStats
Returns whether this player has visited the given room.

Specified by:
hasVisited in interface PlayerStats
Parameters:
R - the room to check and see whether the player has been there.
Returns:
true if the player has been there, false otherwise.
See Also:
PlayerStats.hasVisited(Area), PlayerStats.percentVisited(MOB, Area), PlayerStats.addRoomVisit(Room), PlayerStats.unVisit(Room), PlayerStats.unVisit(Area)

hasVisited

public boolean hasVisited(Area A)
Description copied from interface: PlayerStats
Returns whether this player has visited the given area.

Specified by:
hasVisited in interface PlayerStats
Parameters:
A - the area to check
Returns:
true if the player has been there, false otherwise
See Also:
PlayerStats.hasVisited(Room), PlayerStats.percentVisited(MOB, Area), PlayerStats.addRoomVisit(Room), PlayerStats.unVisit(Room), PlayerStats.unVisit(Area)

unVisit

public void unVisit(Room R)
Description copied from interface: PlayerStats
Deletes the visitation record for the given room

Specified by:
unVisit in interface PlayerStats
Parameters:
R - the room to remove
See Also:
PlayerStats.hasVisited(Room), PlayerStats.hasVisited(Area), PlayerStats.percentVisited(MOB, Area), PlayerStats.unVisit(Area)

unVisit

public void unVisit(Area A)
Description copied from interface: PlayerStats
Deletes the visitation record for all rooms in the given area.

Specified by:
unVisit in interface PlayerStats
Parameters:
A - area of rooms to remove
See Also:
PlayerStats.hasVisited(Room), PlayerStats.hasVisited(Area), PlayerStats.percentVisited(MOB, Area), PlayerStats.unVisit(Room)

percentVisited

public int percentVisited(MOB mob,
                          Area A)
Description copied from interface: PlayerStats
Returns the percentage (0-100) of the given area that the given player has explored.

Specified by:
percentVisited in interface PlayerStats
Parameters:
mob - the player of these stats
A - the Area to check
Returns:
the percent of the area the player has explored
See Also:
PlayerStats.hasVisited(Room), PlayerStats.hasVisited(Area), PlayerStats.addRoomVisit(Room), PlayerStats.unVisit(Room), PlayerStats.unVisit(Area)

leveledDateTime

public long leveledDateTime(int level)
Description copied from interface: PlayerStats
The time, in milis since 1970, that the player gained the given level

Specified by:
leveledDateTime in interface PlayerStats
Parameters:
level - the level to check for
Returns:
the time, in milis since 1970, that the player gained the given level
See Also:
PlayerStats.setLeveledDateTime(int, Room)

setLeveledDateTime

public void setLeveledDateTime(int level,
                               Room R)
Description copied from interface: PlayerStats
Notifies the player records that, at the moment this method was called, the player gained the given level.

Specified by:
setLeveledDateTime in interface PlayerStats
Parameters:
level - the level to set up
R - the room in which the level was gained
See Also:
PlayerStats.leveledDateTime(int)

getAccount

public PlayerAccount getAccount()
Description copied from interface: PlayerStats
If the ACCOUNTSYSTEM is used, this will access the account object that is shared by all players of this account.

Specified by:
getAccount in interface PlayerStats
Returns:
the account object

setAccount

public void setAccount(PlayerAccount account)
Description copied from interface: PlayerStats
If the ACCOUNTSYSTEM is used, this will allow you to set the account object that is shared by all players of this account.

Specified by:
setAccount in interface PlayerStats
Parameters:
account - the account object

compareTo

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