cz.cuni.pogamut.Client
Class AgentStats

java.lang.Object
  extended by cz.cuni.pogamut.Client.AgentStats
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ModifiableAgentStats

public class AgentStats
extends java.lang.Object
implements java.io.Serializable

Wrapper for Agent's collectiong various statistical information. Eg.:

See Also:
Serialized Form

Field Summary
protected  Agent agent
           
protected  int damageCaused
           
protected  int damageSuffered
           
protected  int deaths
           
protected  double enemyTeamScore
           
protected  java.io.Serializable extra
           
protected  int frags
           
protected  int rocketHits
           
protected  double teamScore
           
protected  int wallHits
           
 
Constructor Summary
AgentStats()
           
AgentStats(Agent agent)
          Creates new instance of statiscics collector for an agent.
 
Method Summary
protected  Agent getAgent()
           
 int getDamageCaused()
           
 int getDamageSuffered()
           
 int getDeaths()
           
 double getEnemyTeamScore()
           
 java.io.Serializable getExtra()
           
 int getFrags()
           
 double getTeamScore()
           
 int getWallHits()
           
 void plus(AgentStats s)
          Adds (+) given stats to this object.
private  void registerListeners()
           
 void setAgent(Agent agent)
           
 void setExtra(java.io.Serializable extra)
           
 java.lang.String toString()
          String reprezentation of stats object is automaticaly build using the introspection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

agent

protected transient Agent agent

frags

protected int frags

deaths

protected int deaths

damageCaused

protected int damageCaused

damageSuffered

protected int damageSuffered

wallHits

protected int wallHits

teamScore

protected double teamScore

enemyTeamScore

protected double enemyTeamScore

rocketHits

protected int rocketHits

extra

protected java.io.Serializable extra
Constructor Detail

AgentStats

public AgentStats(Agent agent)
Creates new instance of statiscics collector for an agent.

Parameters:
agent - Agent whose statistics are to be collected.

AgentStats

public AgentStats()
Method Detail

getAgent

protected Agent getAgent()
Returns:
Agent whose statistics are to be collected.

setAgent

public void setAgent(Agent agent)

registerListeners

private void registerListeners()

getFrags

public int getFrags()
Returns:
Number of bots killed by this bot.

getExtra

public java.io.Serializable getExtra()

setExtra

public void setExtra(java.io.Serializable extra)

getDeaths

public int getDeaths()
Returns:
How many times was this bot killed.

getDamageCaused

public int getDamageCaused()
Returns:
How much damage caused the bot to the other bots.

getDamageSuffered

public int getDamageSuffered()
Returns:
How much damage the bot suffered.

toString

public java.lang.String toString()
String reprezentation of stats object is automaticaly build using the introspection. All properties are added to the string.

Overrides:
toString in class java.lang.Object
Returns:
String with all properties and their values

getTeamScore

public double getTeamScore()

getEnemyTeamScore

public double getEnemyTeamScore()

plus

public void plus(AgentStats s)
Adds (+) given stats to this object. Useful for stats agregation.

Parameters:
s -

getWallHits

public int getWallHits()