make states numbers instead of booleans
This commit is contained in:
12
sim/port.lua
12
sim/port.lua
@@ -21,7 +21,7 @@ function Port.new(type, direction, position, causeupdate, idx)
|
||||
direction = direction,
|
||||
position = position,
|
||||
causeupdate = causeupdate,
|
||||
state = false,
|
||||
state = 0,
|
||||
gate = nil,
|
||||
group = nil,
|
||||
idx = idx,
|
||||
@@ -35,17 +35,11 @@ function Port.getconnectionposition(port)
|
||||
end
|
||||
|
||||
function Port.isrising(port)
|
||||
if port.group == nil then
|
||||
return false
|
||||
end
|
||||
return port.group.state and (port.group.update_tick == GSim.current_tick)
|
||||
return port.group.state==1 and (port.group.update_tick == GSim.current_tick)
|
||||
end
|
||||
|
||||
function Port.isfalling(port)
|
||||
if port.group == nil then
|
||||
return false
|
||||
end
|
||||
return port.group.state == false and (port.group.update_tick == GSim.current_tick)
|
||||
return port.group.state==0 and (port.group.update_tick == GSim.current_tick)
|
||||
end
|
||||
|
||||
function Port.getgate(port)
|
||||
|
||||
Reference in New Issue
Block a user