use get/set for parameters on ports and wires

This commit is contained in:
Redo
2021-02-03 09:32:05 -06:00
parent 941348002b
commit 54f45520c0
7 changed files with 118 additions and 74 deletions

View File

@@ -62,10 +62,10 @@ 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]
local type = port.type
local pos = {port.position[1], port.position[2], port.position[3]}
local dir = port.direction
local portd = self.ports[i]
local type = portd.type
local pos = {portd.position[1], portd.position[2], portd.position[3]}
local dir = portd.direction
if dir < 4 then
dir = (dir + rotation) % 4
@@ -84,7 +84,7 @@ function GateDefinition.constructgate(self, 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]}, port.causeupdate))
Gate.addport(gate, Port.new(Port, type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate))
end
return gate