Questions, Comments, or anything else |
Questions, Comments, or anything else |
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; } }