Creates a new Dep
instance for the referenced channel.
Creates a new Dep
instance for the referenced channel.
the variable depended on
the adjustment to derive the value of the dependency from the variable
whether this Dep should submit to the variable.
dependency instance
Dep is very much like a
Val
, but is also aChannel
. The basic purpose is to represent a value dependent upon another variable. An example of this might be if you are representing a positionleft
and you also wanted to representright
as well (which would beleft
+width
). These two variables are dependent upon each other and don't fit well asVar
s. An example usage might be:val left: Var[Double] = Var(0.0) val width: Var[Double] = Var(0.0) val right: Dep[Double, Double] = Dep(left, width)
If an instance is
submissive
it removesadjustment
from being part of the mutation dependency. For example: in the above scenario if you setwidth
to 100.0 andright
to 125.0 thenleft
will be 25.0. Now, what should happen if you changewidth
to 50.0? Shouldleft
change to 75.0 (submissive = false
) or shouldright
change to 75.0 (submissive = true
)?