stop setting metatables on objects

This commit is contained in:
Redo0
2021-05-25 17:28:54 -05:00
parent 4cf2231a01
commit e92cc50186
7 changed files with 11 additions and 21 deletions

View File

@@ -5,7 +5,7 @@ GateDefinition = {
input = function(gate, argv) end
}
function GateDefinition.new(self, objref, name, description, init, logic, input, global, ports)
function GateDefinition.new(objref, name, description, init, logic, input, global, ports)
name = collapseescape(name)
init = collapseescape(init)
@@ -53,13 +53,11 @@ function GateDefinition.new(self, objref, name, description, init, logic, input,
print(global)
end
setmetatable(o, self)
self.__index = self
return o
end
function GateDefinition.constructgate(def, objref, position, rotation)
local gate = Gate.new(Gate, objref, def)
local gate = Gate.new(objref, def)
for i = 1, #def.ports do
local portd = def.ports[i]
@@ -84,7 +82,7 @@ function GateDefinition.constructgate(def, objref, position, rotation)
pos[2] = x
end
Gate.addport(gate, Port.new(Port, type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate))
Gate.addport(gate, Port.new(type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate))
end
return gate