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:
Kazhnuz 2021-07-03 09:52:00 +02:00
parent 7db0ad1b28
commit 72a0b77212

View file

@ -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