Added sorting to all headers to ascending and descending

This commit is contained in:
Tercio Jose
2023-04-21 21:46:36 -03:00
parent 36e5d2978f
commit c9b801e7f0
6 changed files with 160 additions and 151 deletions
+14 -2
View File
@@ -33,8 +33,9 @@ local spellTable_FieldsToSum = {
---@class spelltablemixin
---@field GetCritPercent fun(spellTable: spelltable) : number
---@field GetCritAverage fun(spellTable: spelltable) : number
---@field GetCastAmount fun(spellTable: spelltable, actorName: string, combatObject: combat)
---@field GetCastAverage fun(spellTable: spelltable, castAmount: number)
---@field SumSpellTables fun(spellTables: spelltable[], targetTable: table)
---@field GetCastsAmount fun(spellTable: spelltable, actorName: string, combatObject: combat)
Details.SpellTableMixin = {
---return the critical hits percent
@@ -56,10 +57,21 @@ Details.SpellTableMixin = {
---@param actorName string
---@param combatObject combat
---@return number
GetCastsAmount = function(spellTable, actorName, combatObject)
GetCastAmount = function(spellTable, actorName, combatObject)
return combatObject:GetSpellCastAmount(actorName, spellTable.id)
end,
---return the average damage per cast
---@param spellTable spelltable
---@param castAmount number
---@return number
GetCastAverage = function(spellTable, castAmount)
if (castAmount > 0) then
return spellTable.total / castAmount
end
return 0
end,
---get the array of spelltables and sum each spellTable with the first spellTable found or on targetTable
---only sum the keys found in the spellTable_FieldsToSum table
---@param spellTables spelltable[]