Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require( "component" )
- local meClass = {}
- function meClass:new()
- local o = {}
- self.__index = self
- setmetatable(o, self)
- return o
- end
- function meClass:asArray(table, list)
- local k,v
- local res={}
- for k,v in pairs(table) do
- if type(v) == "table" then
- if type(list) == "table" then
- local i,j
- for i,j in pairs(list) do
- if v.name == j then
- res[j] = v.amount
- end
- end
- else
- res[v.name] = v.amount
- end
- end
- end
- return res
- end
- function meClass:getGases(list)
- local me = component.me_controller
- local gases = me.getGasesInNetwork()
- return meClass:asArray(gases, list)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement