Skip to content

Class DataCollection::DamageCollector

ClassList > DataCollection > DamageCollector

A data collector class for damage of game items. More...

  • #include <DamageCollector.hpp>

Public Functions

Type Name
double CalculateAverageDamage (const std::string & itemName)
DamageCollector () = default
Default constructor for DamageCollector .
std::vector< double > & GetDamageAmounts (std::string itemName)
void RecordDamageResult (const std::string & itemName, double damageAmt)
void WriteToDamageFile (std::string path)

Detailed Description

Useful for setting up graphs for analysis of item balancing.

Public Functions Documentation

function CalculateAverageDamage

inline double DataCollection::DamageCollector::CalculateAverageDamage (
    const std::string & itemName
) 

Calculate average damage for a certain item

Parameters:

  • itemName Item name to calculate average for

Returns:

The average damage as a double, -1 if the item does not exist

function DamageCollector

DataCollection::DamageCollector::DamageCollector () = default

function GetDamageAmounts

inline std::vector< double > & DataCollection::DamageCollector::GetDamageAmounts (
    std::string itemName
) 

Get the damage amounts for a certain item.

Parameters:

  • itemName Name of the item to get damage amounts for

Returns:

Reference to the vector of damage amounts

function RecordDamageResult

inline void DataCollection::DamageCollector::RecordDamageResult (
    const std::string & itemName,
    double damageAmt
) 

Store a damage amount for a certain item.

Parameters:

  • itemName Name of the item to store the damage for
  • damageAmt Amount of damage this item did

function WriteToDamageFile

inline void DataCollection::DamageCollector::WriteToDamageFile (
    std::string path
) 

The documentation for this class was generated from the following file source/DataCollection/DamageCollector.hpp