stop using self in class functions
This commit is contained in:
34
sim/wire.lua
34
sim/wire.lua
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user