package com.pesets.game;

public class PlayerStatistics {
	private static PlayerStatistics instance = new PlayerStatistics();
	public static PlayerStatistics getInstance() {
		return instance;
	}

	public float totalTimePlayed = 0;
	public float timePlayed = 0;
	public float timeSpendDead = 0;
	public float timeInBattle = 0;
	public float damageDealt = 0;
	public int enemiesKilled = 0;
	public float skillCasted = 0;
	public float damageBySkills = 0;
	public int expEarned = 0;
	
	public float getDeadPrecent()
	{
		if (timePlayed == 0) return 0;
		return timeSpendDead / timePlayed;
	}
	
	public float getBattlePrecent()
	{
		if (timePlayed == 0) return 0;
		return timeInBattle / timePlayed;
	}
	
	public float getSkillDmgPrecent()
	{
		if (damageDealt == 0) return 0;
		return damageBySkills / damageDealt;
	}
	
	public float expPerSecond()
	{
		if (timePlayed == 0) return 0.01f;
		return expEarned / timePlayed;
	}
	
	public void reset()
	{
		timePlayed = 0;
		timeSpendDead = 0;
		timeInBattle = 0;
		damageDealt = 0;
		enemiesKilled = 0;
		skillCasted = 0;
		damageBySkills = 0;
		expEarned = 0;
	}
}
