lua-logic/sim/wire.lua
2021-02-03 09:17:33 -06:00

29 lines
500 B
Lua

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