Documentation for this module may be created at Module:Char Stat/doc
---@type Util
local util = require("Module:Util")
local Stat = {}
Stat.__index = Stat
function Stat:new(trion, attack, defense, mobility, skill, range, mechanical_operation, data_analysis,
parallel_processing, tactics, command, special_tactics)
local res = Stat
setmetatable(res, Stat)
res.trion = tonumber(trion) or 0
res.attack = tonumber(attack) or 0
res.defense = tonumber(defense) or 0
res.mobility = tonumber(mobility) or 0
res.skill = tonumber(skill) or 0
res.range = tonumber(range) or 0
res.mechanical_operation = tonumber(mechanical_operation) or 0
res.data_analysis = tonumber(data_analysis) or 0
res.parallel_processing = tonumber(parallel_processing) or 0
res.tactics = tonumber(tactics) or 0
res.command = tonumber(command) or 0
res.special_tactics = tonumber(special_tactics) or 0
return res
end
function Stat:from_table(table)
return Stat:new(unpack(table, 1, 12))
end
---@param frame frame
function Stat:from_frame(frame)
local args, _ = util.get_args_and_pargs(frame)
return Stat:from_table(args)
end
return Stat