Skip to content
Snippets Groups Projects
Unverified Commit b0d5f027 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Process events

parent 2e33c5c7
No related branches found
No related tags found
1 merge request!2Define variables through new @defvar macro
......@@ -322,6 +322,15 @@ function (var::Variable)(block::AbstractBlock, args...; kwargs...)
return var.f(block, args...; kwargs...)
end
# Special case for BuildingBlock events
function (var::Variable)(event::Tuple{<:Number, <:AbstractBlock}, args...; kwargs...)
if applicable(var.f, event, args...; kwargs...)
return var.f(event, args...; kwargs...)
end
# falling back to just processing the `AbstractBlock`
return var(event[2], args...; kwargs...)
end
function (var::AlternateVariable)(args...; kwargs...)
other_var = variables[var.other_var]
apply_from_other(res::Number) = var.from_other(res)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment