system.lua 424 B

123456789101112131415161718192021222324252627
  1. -- create containers for all script entitys
  2. System = {}
  3. EntityContainer = {}
  4. UiContainer = {}
  5. function table.copy( t )
  6. if type( t ) ~= "table" then
  7. return t
  8. end
  9. local mt = getmetatable( t )
  10. local res = {}
  11. for k, v in pairs( t ) do
  12. if type( v ) == "table" then
  13. v = table.copy( v )
  14. end
  15. res[ k ] = v
  16. end
  17. setmetatable( res, mt )
  18. return res
  19. end