fix: put the stats in an internal list
It'll allow us later to even drop the internal list and replace it by automatic computation
This commit is contained in:
parent
7db0ad1b28
commit
72a0b77212
1 changed files with 3 additions and 2 deletions
|
@ -16,8 +16,9 @@ function StatManager:new(owner)
|
|||
end
|
||||
|
||||
function StatManager:setStats(stats)
|
||||
self.list = {}
|
||||
for key, value in pairs(stats) do
|
||||
self[key] = value
|
||||
self.list[key] = value
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -26,7 +27,7 @@ function StatManager:get(statname)
|
|||
end
|
||||
|
||||
function StatManager:computeStat(statname)
|
||||
return self[statname]
|
||||
return self.list[statname]
|
||||
end
|
||||
|
||||
return StatManager
|
Loading…
Reference in a new issue