[Home]UnderDark3/Stats.java

Robo Home | UnderDark3 | Changes | Preferences | AllPages

Stats.java


package matt;

public class Stats {
    public int fired;
    public int eBullets;
    public int hitsDone;
    public int hitsTaken;
    public double dmgDone;
    public double dmgTaken;
    public double travelDist;
    
    public Stats() {
        this.fired=0;
        this.eBullets=0;
        this.hitsDone=0;
        this.hitsTaken=0;
        this.dmgDone=0;
        this.dmgTaken=0;
        this.travelDist=0;
    }
    
    public void shot(){
        this.fired+=1;
    }
    
    public void enemyBullet(){
        this.eBullets+=1;
    }
    
    public void hitTaken(){
        this.hitsTaken+=1;
    }
    
    public void hitDone(){
        this.hitsDone+=1;
    }
    
    public void dmgDone(double dmg){
        this.dmgDone += dmg;
    }
    
    public void dmgTaken(double dmg){
        this.dmgTaken += dmg;
    }
    
    public void travel(double dist){
        this.travelDist += dist;
    }
   
    public double getAcc(){
        if(this.fired!=0)
            return (double)this.hitsDone/(double)this.fired;
        else
            return 1;
    }
}

Questions, Comments, or anything else

Robo Home | UnderDark3 | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited July 15, 2005 22:26 EST by UnderDark (diff)
Search: