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

@@ -1,8 +1,9 @@
Wire = {
logictype = 0
}
function Wire:new(objref, layer, bounds)
function Wire.new(self, objref, layer, bounds)
local o = {
objref = objref,
layer = layer,
@@ -14,14 +15,14 @@ function Wire:new(objref, layer, bounds)
return o
end
function Wire:setlayer(layer)
function Wire.setlayer(self, layer)
if self.group ~= nil then
self.group:removewire(self)
Group.removewire(self.group, self)
end
self.layer = layer
sim:connectwire(self)
Simulation.connectwire(sim, self)
end
function Wire:update()
function Wire.update(self)
client:send("WU\t" .. bool_to_int[self.group.state] .. "\t" .. self.objref .. "\n")
end