Package stawa.vitalstrike
Class PlayerStats.PlayerStatistics
java.lang.Object
stawa.vitalstrike.PlayerStats.PlayerStatistics
- Enclosing class:
PlayerStats
Represents a player's combat statistics.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDamage(double damage) Adds damage to the player's total damage dealt and increments the total hits.doubleGets the average damage per hit.intGets the highest combo achieved by the player.doubleGets the total damage dealt by the player.intGets the total number of hits landed by the player.voidupdateCombo(int combo) Updates the player's highest combo if the provided combo is higher.
-
Constructor Details
-
PlayerStatistics
public PlayerStatistics()Creates a new PlayerStatistics instance.
-
-
Method Details
-
getHighestCombo
public int getHighestCombo()Gets the highest combo achieved by the player.- Returns:
- the highest combo
-
getTotalDamageDealt
public double getTotalDamageDealt()Gets the total damage dealt by the player.- Returns:
- the total damage dealt
-
getAverageDamagePerHit
public double getAverageDamagePerHit()Gets the average damage per hit.- Returns:
- the average damage per hit
-
getTotalHits
public int getTotalHits()Gets the total number of hits landed by the player.- Returns:
- the total hits
-
updateCombo
public void updateCombo(int combo) Updates the player's highest combo if the provided combo is higher.- Parameters:
combo- the new combo to check
-
addDamage
public void addDamage(double damage) Adds damage to the player's total damage dealt and increments the total hits.- Parameters:
damage- the damage to add
-