Fork me on GitHub

object.lua

#

The file is part of the BURN project (learing multi-objective rules).
Because learning is not the filling a pail, but the lighting of a fire.

index | discuss | license


Object Stuff

#

Object:new(o)

Create the any base object

local Object={}

function Object:new(o)
  o = o or {}   -- create object if user does not provide one
  setmetatable(o, self)
  if not self.id then self.id=0 end
  self.id = self.id and self.id+1 or 1
  o.id    = self.id
  self.__index = self
  return o
end

return Object