remove colon syntax from oop

This commit is contained in:
Redo
2021-02-03 09:17:33 -06:00
parent 1b7915de4c
commit 941348002b
7 changed files with 124 additions and 120 deletions

View File

@@ -5,7 +5,7 @@ GateDefinition = {
input = function(gate, argv) end
}
function GateDefinition:new(objref, name, description, init, logic, input, global, ports)
function GateDefinition.new(self, objref, name, description, init, logic, input, global, ports)
name = collapseescape(name)
init = collapseescape(init)
@@ -58,8 +58,8 @@ function GateDefinition:new(objref, name, description, init, logic, input, globa
return o
end
function GateDefinition:constructgate(objref, position, rotation)
local gate = Gate:new(objref, self)
function GateDefinition.constructgate(self, objref, position, rotation)
local gate = Gate.new(Gate, objref, self)
for i = 1, #self.ports do
local port = self.ports[i]
@@ -84,7 +84,7 @@ function GateDefinition:constructgate(objref, position, rotation)
pos[2] = x
end
gate:addport(Port:new(type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, port.causeupdate))
Gate.addport(gate, Port.new(Port, type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, port.causeupdate))
end
return gate