stop using self in class functions

This commit is contained in:
Redo0
2021-05-25 17:25:34 -05:00
parent 730ca3fd64
commit 4cf2231a01
4 changed files with 226 additions and 226 deletions

View File

@@ -22,34 +22,34 @@ function Wire.new(self, objref, layer, bounds)
return o
end
function Wire.setlayer(self, layer)
if self.group ~= nil then
Group.removewire(self.group, self)
function Wire.setlayer(wire, layer)
if wire.group ~= nil then
Group.removewire(wire.group, wire)
end
self.layer = layer
Simulation.connectwire(GSim, self)
wire.layer = layer
Simulation.connectwire(GSim, wire)
end
function Wire.update(self)
client:send("WU\t" .. bool_to_int[self.group.state] .. "\t" .. self.objref .. "\n")
function Wire.update(wire)
client:send("WU\t" .. bool_to_int[wire.group.state] .. "\t" .. wire.objref .. "\n")
end
function Wire.setgroup(self, group)
self.group = group
function Wire.setgroup(wire, group)
wire.group = group
end
function Wire.getgroup(self)
return self.group
function Wire.getgroup(wire)
return wire.group
end
function Wire.getobjref(self)
return self.objref
function Wire.getobjref(wire)
return wire.objref
end
function Wire.getlayer(self)
return self.layer
function Wire.getlayer(wire)
return wire.layer
end
function Wire.getbounds(self)
return self.bounds
function Wire.getbounds(wire)
return wire.bounds
end