make sim use proper OOP
This commit is contained in:
14
sim/gate.lua
14
sim/gate.lua
@@ -38,18 +38,22 @@ function Gate.getportisrising(self, index)
|
||||
return Port.isrising(self.ports[index])
|
||||
end
|
||||
|
||||
function Gate:getportisfalling(index)
|
||||
function Gate.getportisfalling(self, index)
|
||||
return Port.isfalling(self.ports[index])
|
||||
end
|
||||
|
||||
function Gate.cb(gate, ...)
|
||||
Simulation.queuecallback(gate.sim, gate, ...)
|
||||
Simulation.queuecallback(Gate.getsim(gate), gate, ...)
|
||||
end
|
||||
|
||||
function Gate.queue(self, delay)
|
||||
Simulation.queuegatelater(self.sim, self, delay)
|
||||
function Gate.queue(gate, delay)
|
||||
Simulation.queuegatelater(Gate.getsim(gate), gate, delay)
|
||||
end
|
||||
|
||||
function Gate.gettick(gate)
|
||||
return gate.sim.currenttick
|
||||
return Gate.getsim(gate).currenttick
|
||||
end
|
||||
|
||||
function Gate.getsim(gate)
|
||||
return gate.sim
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user