|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.fuckingbrit.q3astats.LogOwner
The LogOwner encapsulates the person we are parsing the logs for. This class stores all the information we know about the user, and handles the storage and retrieval of this information. This information is stored as an XML File in the current implementation, although I plan to abstract this layer a little further in later releases.
Constructor Summary | |
LogOwner(java.io.File playerLog)
Create a new player, by passing in an XML document that details the logs parsed to date. |
|
LogOwner(java.lang.String name)
Create a new player by name only |
Method Summary | |
int |
getDeaths()
Gets the total number of times this player has been killed. |
java.util.HashMap |
getHits()
Get the hits this player has caused. |
int |
getKills()
Returns the players total recorded kills |
java.lang.String |
getName()
Gets the players name. |
java.util.HashMap |
getPlayers()
Gets the players that this player has encountered. |
boolean |
getRegexMode()
Gets the regex mode. |
java.lang.String |
getRegexString()
Get the current regex of the name matcher |
int |
getSuicides()
Gets the number of recorded suicides for this log player. |
boolean |
isMe(java.lang.String name)
This method is a critical function of the logowner. |
void |
logDeath(java.lang.String killer,
java.lang.String weapon)
Log a Death. |
void |
logHit(java.lang.String where)
Log a hit. |
void |
logKill(java.lang.String victim,
java.lang.String weapon)
Log a Kill. |
void |
setDeaths(int deaths)
Sets the total number of times player has been killed. |
void |
setKills(int kills)
Set the total kills by the player. |
void |
setName(java.lang.String name)
Sets the players name. |
void |
setRegexMode(boolean active)
Sets the regex mode to active. |
void |
setRegexString(java.lang.String regex)
Sets the regular expression string. |
void |
setSuicides(int suicides)
Sets the number of suicides found for this log player |
void |
toXML(java.io.File where)
Store this player as an XML packet |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LogOwner(java.lang.String name)
name
- the name of the player.public LogOwner(java.io.File playerLog) throws QuakeParseException
QuakeParseException
- If for any reason the XML can not be read.Method Detail |
public void setSuicides(int suicides)
suicides
- Number of suicidespublic int getSuicides()
public java.util.HashMap getPlayers()
Player
public java.util.HashMap getHits()
Hit
public void setName(java.lang.String name)
name
- The players name.public java.lang.String getName()
public void setKills(int kills)
kills
- number of kills.public int getKills()
public void setDeaths(int deaths)
deaths
- Count of Deaths.public int getDeaths()
public void setRegexMode(boolean active) throws QuakeParseException
active
- Sets on or off.
QuakeParseException
- If there is no regex string set.public boolean getRegexMode()
public void setRegexString(java.lang.String regex) throws QuakeParseException
regex
- The regular expression to use.
QuakeParseException
- if the regex string won't compile.public java.lang.String getRegexString()
public void toXML(java.io.File where) throws QuakeParseException
where
- A File to save to.
QuakeParseException
- if anything causes the save of the XML to fail.public void logKill(java.lang.String victim, java.lang.String weapon)
victim
- Who was killedweapon
- What they were killed withpublic void logDeath(java.lang.String killer, java.lang.String weapon)
killer
- Who killed us?weapon
- What with?public void logHit(java.lang.String where)
where
- where we were hit.public boolean isMe(java.lang.String name)
name
- THe name to match against.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |