Esempio n. 1
0
        protected void CopyTo(
            BasicRandomizableValue <T, Parameter> r, int cloneFlags)
        {
            if (!Bits.IsSet(cloneFlags, Utilities.CloneZero))
            {
                r.initial_.Value  = initial_.Value;
                r.range_.Value    = range_.Value;
                r.interval_.Value = interval_.Value;
            }

            r.current_      = initial_.Value;
            r.elapsed_      = 0;
            r.totalElapsed_ = float.MaxValue;
            r.dirty_        = true;
        }
Esempio n. 2
0
        public override void SetValue(
            BasicRandomizableValue <float, FloatParameter> value)
        {
            base.SetValue(value);

            if (value == null)
            {
                return;
            }

            if (value.ActualInterval == 0)
            {
                // always
                progress_.Value = 1;
                progress_.Range = new FloatRange(0, 1);
            }
            else
            {
                progress_.Set(0, value.Current, value.Elapsed);
            }
        }
Esempio n. 3
0
        public virtual void SetValue(BasicRandomizableValue <T, Parameter> value)
        {
            if (value == null)
            {
                return;
            }

            current_.SetFromRange(value.Initial, value.Range, value.Current);

            next_.Text  = MakeNextLabel(value.ActualInterval);
            next_.Range = new FloatRange(0, value.ActualInterval);

            if (value.ActualInterval == 0)
            {
                next_.Value = 0;
            }
            else
            {
                next_.Value = value.TotalElapsed;
            }
        }