com.fuckingbrit.q3astats
Class Player

java.lang.Object
  |
  +--com.fuckingbrit.q3astats.Player

public class Player
extends java.lang.Object

The player class is used to encapsulate an urban terror player. A player is not intended to store self. A player will store the number of kills/deaths by each weapon and a count of suicides.

This class is not for tracking the primary player (Primary Player is the person who produced the log files) but for killing Enemy players.

Kills - Number of time Player was killed by Primary Player
Deaths - Number of times Primary Player was killed by Player

Version:
1.0
Author:
Michael Jervis (mike@fuckingbrit.com)

Field Summary
 java.lang.String name
          The name of the player.
 int suicides
          Count of suicides
 java.util.Hashtable weapons
           
 
Constructor Summary
Player(java.lang.String name)
          Player constructor with a player name specified.
 
Method Summary
 void addDeath(java.lang.String weaponname)
          Routine to add a death by weapon:
 void addKill(java.lang.String weaponname)
          Routine to add a kill by weapon:
protected  void addWeapon(Weapon wep)
          For loading up internaly from parsing a pre-existing player XML
 int getDeaths()
          Routine to get total deaths of this player.
 int getDeathsBy(java.lang.String weaponname)
          Routine to get deaths by weapon
 int getKills()
          Routine to get total kills of this player.
 int getKillsBy(java.lang.String weaponname)
          Routine to get kills by weapon
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
The name of the player. The UT2 Nick.


suicides

public int suicides
Count of suicides


weapons

public java.util.Hashtable weapons
Constructor Detail

Player

public Player(java.lang.String name)
Player constructor with a player name specified.

Parameters:
name - player character name (nick)
Method Detail

addKill

public void addKill(java.lang.String weaponname)
Routine to add a kill by weapon:

Parameters:
weaponname - string identifier for weapon.

addDeath

public void addDeath(java.lang.String weaponname)
Routine to add a death by weapon:

Parameters:
weaponname - string identifier for weapon.

getDeathsBy

public int getDeathsBy(java.lang.String weaponname)
Routine to get deaths by weapon

Parameters:
weaponname - string identifier for weapon to count.
Returns:
int count of deaths

getKillsBy

public int getKillsBy(java.lang.String weaponname)
Routine to get kills by weapon

Parameters:
weaponname - string identifier for weapon to count.
Returns:
int count of kills

getKills

public int getKills()
Routine to get total kills of this player.

Returns:
int number of times primary player has killed this player

getDeaths

public int getDeaths()
Routine to get total deaths of this player.

Returns:
int number of times player has killed primary player

addWeapon

protected void addWeapon(Weapon wep)
For loading up internaly from parsing a pre-existing player XML


toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object