diff options
| -rw-r--r-- | obj.lua | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -74,6 +74,14 @@ function obj.all() end) end +function obj.total_energy() + local res = 0 + for obj in obj.all() do + res = res + obj:energy() + end + return res +end + function obj:__index(v) if obj[v] then return obj[v] |
