stop using self in class functions
This commit is contained in:
26
sim/gate.lua
26
sim/gate.lua
@@ -23,33 +23,33 @@ function Gate.new(self, objref, definition)
|
||||
return o
|
||||
end
|
||||
|
||||
function Gate.addport(self, port)
|
||||
self.ports[#self.ports+1] = port
|
||||
Port.setgate(port, self)
|
||||
function Gate.addport(gate, port)
|
||||
gate.ports[#gate.ports+1] = port
|
||||
Port.setgate(port, gate)
|
||||
end
|
||||
|
||||
function Gate.getportstate(gate, index)
|
||||
return gate.ports[index].group.state
|
||||
end
|
||||
|
||||
function Gate.setportstate(self, index, state)
|
||||
Port.setstate(self.ports[index], state)
|
||||
function Gate.setportstate(gate, index, state)
|
||||
Port.setstate(gate.ports[index], state)
|
||||
end
|
||||
|
||||
function Gate.initdata(self)
|
||||
self.data = {}
|
||||
function Gate.initdata(gate)
|
||||
gate.data = {}
|
||||
end
|
||||
|
||||
function Gate.getdata(self)
|
||||
return self.data
|
||||
function Gate.getdata(gate)
|
||||
return gate.data
|
||||
end
|
||||
|
||||
function Gate.getportisrising(self, index)
|
||||
return Port.isrising(self.ports[index])
|
||||
function Gate.getportisrising(gate, index)
|
||||
return Port.isrising(gate.ports[index])
|
||||
end
|
||||
|
||||
function Gate.getportisfalling(self, index)
|
||||
return Port.isfalling(self.ports[index])
|
||||
function Gate.getportisfalling(gate, index)
|
||||
return Port.isfalling(gate.ports[index])
|
||||
end
|
||||
|
||||
function Gate.cb(gate, ...)
|
||||
|
||||
Reference in New Issue
Block a user