com.planet_ink.coffee_mud.Common.interfaces
Interface PlayerStats

All Superinterfaces:
java.lang.Cloneable, CMCommon, CMModifiable, CMObject, java.lang.Comparable<CMObject>
All Known Implementing Classes:
DefaultPlayerStats

public interface PlayerStats
extends CMCommon, CMModifiable

Accessible from any PC mob object, PlayerStats are the repository for all manner of player specific mob values.

See Also:
MOB.playerStats()

Field Summary
static long HYGIENE_COMMONDIRTY
          Constant for hygeine system, denotes amount of dirtiness from using common skills
static long HYGIENE_DELIMIT
          Constant for hygeine system, denotes ceiling of stinkiness before emoting
static long HYGIENE_FIGHTDIRTY
          Constant for hygeine system, denotes amount of dirtiness from fighting
static long HYGIENE_WATERCLEAN
          Constant for hygeine system, denotes amount of cleaning water does per tick
static int REPLY_SAY
          Constant for private messenging, means the last private msg was a SAYTO
static int REPLY_TELL
          Constant for private messenging, means the last private msg was a TELL
static int REPLY_YELL
          Constant for private messenging, means the last private msg was a YELL
 
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.
 void delAliasName(java.lang.String named)
          Removes an old alias command for this player.
 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.
 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.
 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.HashSet getFriends()
          Returns a modifiable HashSet that contains the set of player Names that constitutes this players friends.
 java.util.Vector getGTellStack()
          Returns a Vector of the last few string messages sent and received to and from this players group.
 long getHygiene()
          Returns a long value of how stinky this player is.
 java.util.HashSet getIgnored()
          Returns a modifiable HashSet that contains the set of player Names that constitutes this players ignored player list.
 java.lang.String getPrompt()
          Returns the custom prompt, an encoded string, for this player.
 java.util.Vector getSecurityGroups()
          Returns a modifiable Vector of security flags and groups strings to which this player is privileged.
 java.util.Vector getTellStack()
          Returns a Vector of the last few string messages sent and received to and from this player.
 java.util.Vector getTitles()
          Returns a Vector of modifiable title definitions.
 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.
 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 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.
 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
 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 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 color)
          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 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 prompt)
          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 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.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMModifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 

Field Detail

REPLY_SAY

static final int REPLY_SAY
Constant for private messenging, means the last private msg was a SAYTO

See Also:
Constant Field Values

REPLY_YELL

static final int REPLY_YELL
Constant for private messenging, means the last private msg was a YELL

See Also:
Constant Field Values

REPLY_TELL

static final int REPLY_TELL
Constant for private messenging, means the last private msg was a TELL

See Also:
Constant Field Values

HYGIENE_DELIMIT

static final long HYGIENE_DELIMIT
Constant for hygeine system, denotes ceiling of stinkiness before emoting

See Also:
Constant Field Values

HYGIENE_WATERCLEAN

static final long HYGIENE_WATERCLEAN
Constant for hygeine system, denotes amount of cleaning water does per tick

See Also:
Constant Field Values

HYGIENE_COMMONDIRTY

static final long HYGIENE_COMMONDIRTY
Constant for hygeine system, denotes amount of dirtiness from using common skills

See Also:
Constant Field Values

HYGIENE_FIGHTDIRTY

static final long HYGIENE_FIGHTDIRTY
Constant for hygeine system, denotes amount of dirtiness from fighting

See Also:
Constant Field Values
Method Detail

getEmail

java.lang.String getEmail()
Returns the players email address, if available.

Returns:
the players email address, if available.
See Also:
setEmail(String)

setEmail

void setEmail(java.lang.String newAdd)
Sets the players email address, if available.

Parameters:
newAdd - the players email address, if available.
See Also:
getEmail()

lastDateTime

long lastDateTime()
The time, in milis since 1970, that the player last logged off.

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

setLastDateTime

void setLastDateTime(long C)
Sets the time, in milis since 1970, that the player last logged off.

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

lastUpdated

long lastUpdated()
The time, in milis since 1970, that the player was last saved.

Returns:
the time, in milis since 1970, that the player was last saved.
See Also:
setLastUpdated(long)

setLastUpdated

void setLastUpdated(long time)
Sets the time, in milis since 1970, that the player was last saved.

Parameters:
time - the time, in milis since 1970, that the player was last saved.
See Also:
lastUpdated()

leveledDateTime

long leveledDateTime(int level)
The time, in milis since 1970, that the player gained the given level

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

setLeveledDateTime

void setLeveledDateTime(int level,
                        Room R)
Notifies the player records that, at the moment this method was called, the player gained the given level.

Parameters:
level - the level to set up
R - the room in which the level was gained
See Also:
leveledDateTime(int)

password

java.lang.String password()
Returns the players password.

Returns:
the players password.
See Also:
setPassword(String)

setPassword

void setPassword(java.lang.String newPassword)
Sets the players password.

Parameters:
newPassword - the players password.
See Also:
password()

getChannelMask

int getChannelMask()
Returns a bitmask of channels turned on/off. (32 channels supported)

Returns:
a bitmask of channels turned on/off. (1=off)
See Also:
setChannelMask(int)

setChannelMask

void setChannelMask(int newMask)
Sets the bitmask of channels turned on/off. (32 channels supported)

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

getColorStr

java.lang.String getColorStr()
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.

Returns:
a custom coded color string
See Also:
setColorStr(String)

setColorStr

void setColorStr(java.lang.String color)
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.

Parameters:
color - a custom coded color string
See Also:
getColorStr()

getWrap

int getWrap()
Returns the word wrap column number for this player, or 0.

Returns:
the word wrap column number for this player, or 0.
See Also:
setWrap(int)

setWrap

void setWrap(int newWrap)
Sets the word wrap column number for this player, or 0.

Parameters:
newWrap - the word wrap column number for this player, or 0.
See Also:
getWrap()

getPrompt

java.lang.String getPrompt()
Returns the custom prompt, an encoded string, for this player. "" means default is used.

Returns:
the custom prompt, an encoded string, or ""
See Also:
setPrompt(String)

setPrompt

void setPrompt(java.lang.String prompt)
Sets the custom prompt, an encoded string, for this player. "" means default is used.

Parameters:
prompt - the custom prompt, an encoded string, or ""
See Also:
getPrompt()

notes

java.lang.String notes()
Returns the administrative notes entered about this player.

Returns:
the administrative notes entered about this player.
See Also:
setNotes(String)

setNotes

void setNotes(java.lang.String newnotes)
Sets the administrative notes entered about this player.

Parameters:
newnotes - the administrative notes entered about this player.
See Also:
notes()

getFriends

java.util.HashSet getFriends()
Returns a modifiable HashSet that contains the set of player Names that constitutes this players friends.

Returns:
a set of player friend names

getIgnored

java.util.HashSet getIgnored()
Returns a modifiable HashSet that contains the set of player Names that constitutes this players ignored player list.

Returns:
a set of player ignored player list Names

getTitles

java.util.Vector getTitles()
Returns a Vector of modifiable title definitions. These are things like *, the bunny slayer and such.

Returns:
a Vector of modifiable title definitions
See Also:
getActiveTitle()

getActiveTitle

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

Returns:
a title being used by this player
See Also:
getTitles()

getTellStack

java.util.Vector getTellStack()
Returns a Vector of the last few string messages sent and received to and from this player.

Returns:
a Vector of strings, the last few tell messages
See Also:
addTellStack(String)

addTellStack

void addTellStack(java.lang.String msg)
Adds a new string message to the tell stack.

Parameters:
msg - the new message for the tell stack.
See Also:
getTellStack()

getGTellStack

java.util.Vector getGTellStack()
Returns a Vector of the last few string messages sent and received to and from this players group.

Returns:
a Vector of strings, the last few gtell messages
See Also:
addGTellStack(String)

addGTellStack

void addGTellStack(java.lang.String msg)
Adds a new string message to the gtell stack.

Parameters:
msg - the new message for the gtell stack.
See Also:
getGTellStack()

poofIn

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

Returns:
the poof-in GOTO message
See Also:
poofOut(), setPoofs(String, String, String, String)

poofOut

java.lang.String poofOut()
For player with the GOTO command, this is the message seen by all when the player leaves using GOTO.

Returns:
the poof-out GOTO message
See Also:
poofIn(), setPoofs(String, String, String, String)

tranPoofIn

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

Returns:
the poof-in TRANSFER message
See Also:
tranPoofOut(), setPoofs(String, String, String, String)

tranPoofOut

java.lang.String tranPoofOut()
For player with the TRANSFER command, this is the message seen by all when the player leaves using TRANSFER.

Returns:
the poof-out TRANSFER message
See Also:
tranPoofIn(), setPoofs(String, String, String, String)

setPoofs

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.

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:
tranPoofIn(), tranPoofOut(), poofIn(), poofOut()

announceMessage

java.lang.String announceMessage()
For players with the ANNOUNCE command, this is the message used to prefix the announcements proclaimed.

Returns:
prefix to announcements
See Also:
setAnnounceMessage(String)

setAnnounceMessage

void setAnnounceMessage(java.lang.String msg)
For players with the ANNOUNCE command, this sets the message used to prefix the announcements proclaimed.

Parameters:
msg - prefix to announcements
See Also:
announceMessage()

lastIP

java.lang.String lastIP()
The last IP address this player logged in from.

Returns:
the last IP address this player logged in from.
See Also:
setLastIP(String)

setLastIP

void setLastIP(java.lang.String ip)
Sets the last IP address this player logged in from.

Parameters:
ip - the last IP address this player logged in from.
See Also:
lastIP()

replyTo

MOB replyTo()
Returns the last MOB player who sent this player a private instant message.

Returns:
the last MOB player who sent this player a private instant message.
See Also:
setReplyTo(MOB, int), replyType(), replyTime()

setReplyTo

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

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

replyType

int replyType()
Returns the type of private message last sent to this player, an encoded constant.

Returns:
the type of private message last sent to this player
See Also:
setReplyTo(MOB, int), replyTo(), replyTime(), REPLY_SAY, REPLY_TELL, REPLY_YELL

replyTime

long replyTime()
Returns the last time, in millis since 1970, that a player last sent this playe a private message.

Returns:
the last time this player got a private message
See Also:
setReplyTo(MOB, int), replyTo(), replyType()

getSecurityGroups

java.util.Vector getSecurityGroups()
Returns a modifiable Vector of security flags and groups strings to which this player is privileged.

Returns:
a Vector of security flags and groups strings

initializeBirthday

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.

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

getBirthday

int[] getBirthday()
Returns a 2-dimensional integer array with the players birth day and month (in mud calendar)

Returns:
a 2-dimensional integer array (day/month)
See Also:
initializeBirthday(int, Race)

getHygiene

long getHygiene()
Returns a long value of how stinky this player is.

Returns:
how stinky this player is
See Also:
adjHygiene(long), setHygiene(long), HYGIENE_DELIMIT

adjHygiene

boolean adjHygiene(long byThisMuch)
Modifies, up or down, how stinky this player is.

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

setHygiene

void setHygiene(long newVal)
Sets the number meaning how stinky this player is.

Parameters:
newVal - how stinky this player is.
See Also:
getHygiene(), adjHygiene(long), HYGIENE_DELIMIT

hasVisited

boolean hasVisited(Room R)
Returns whether this player has visited the given room.

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:
hasVisited(Area), percentVisited(MOB, Area), addRoomVisit(Room)

hasVisited

boolean hasVisited(Area A)
Returns whether this player has visited the given area.

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

percentVisited

int percentVisited(MOB mob,
                   Area A)
Returns the percentage (0-100) of the given area that the given player has explored.

Parameters:
mob - the player of these stats
A - the Area to check
Returns:
the percent of the area the player has explored
See Also:
hasVisited(Room), hasVisited(Area), addRoomVisit(Room)

addRoomVisit

void addRoomVisit(Room R)
Records the fact that this player has been to the given room.

Parameters:
R - the room to credit the player with
See Also:
hasVisited(Room), hasVisited(Area), percentVisited(MOB, Area)

getAliasNames

java.lang.String[] getAliasNames()
Returns the string array set of defined alias commands for this player.

Returns:
the string array set of defined alias commands.
See Also:
getAlias(String), addAliasName(String), delAliasName(String), setAlias(String, String)

getAlias

java.lang.String getAlias(java.lang.String named)
Returns the definition of the given alias command for this player.

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

addAliasName

void addAliasName(java.lang.String named)
Adds a new alias command for this player, undefined at first.

Parameters:
named - the name of the alias command to add
See Also:
getAliasNames(), getAlias(String), delAliasName(String), setAlias(String, String)

delAliasName

void delAliasName(java.lang.String named)
Removes an old alias command for this player.

Parameters:
named - the name of the alias command to delete
See Also:
getAliasNames(), getAlias(String), addAliasName(String), setAlias(String, String)

setAlias

void setAlias(java.lang.String named,
              java.lang.String value)
Modifies the commands executed by an existing alias command.

Parameters:
named - the alias command to modify
value - the new command(s) to execute
See Also:
getAliasNames(), getAlias(String), addAliasName(String), delAliasName(String)

isIntroducedTo

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.

Parameters:
name - the name of the other player
Returns:
true if this player has met that one, false otherwise
See Also:
introduceTo(String)

introduceTo

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.

Parameters:
name - the player whom this player just met.
See Also:
isIntroducedTo(String)

getAccountExpiration

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)

Returns:
the time, in milis, that this player expires.
See Also:
setAccountExpiration(long)

setAccountExpiration

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)

Parameters:
newVal - the time, in milis, that this player expires.
See Also:
getAccountExpiration()

getXML

java.lang.String getXML()
Returns an XML representation of all the data in this object, for persistant storage.

Returns:
an XML representation of all the data in this object
See Also:
setXML(String)

setXML

void setXML(java.lang.String str)
Restores the data in this object from an XML document.

Parameters:
str - an XML representation of all the data in this object
See Also:
getXML()

sameAs

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

Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
CMModifiable.getStatCodes(), CMModifiable.getStat(String)