Higher order “methods” in lua
snippet in lua

Higher order “methods” in lua

user6986

function BatchGameObjects:Apply(function_name)
   -- ... or iterate on objects in any other way that matches how you store them ...
   for idx = 1, #self.object_list do
      local object = self.object_list[idx]
      object[function_name](object)
   end
end