Пример #1
0
        public override IDuration Clone(int cloneFlags = 0)
        {
            var d = new RandomDuration();

            CopyTo(d, cloneFlags);
            return(d);
        }
Пример #2
0
        public override void AddToUI(IDuration d)
        {
            duration_ = d as RandomDuration;
            if (duration_ == null)
            {
                return;
            }

            foreach (var w in timeWidgets_.GetWidgets())
            {
                widgets_.AddToUI(w);
            }
        }
Пример #3
0
        public Delay(IDuration d, bool halfway, bool endForwards)
        {
            if (d == null)
            {
                HalfwayDuration = new RandomDuration();
            }
            else
            {
                HalfwayDuration = d;
            }

            EndForwardsDuration  = new RandomDuration();
            EndBackwardsDuration = new RandomDuration();
            halfway_.Value       = halfway;
            endForwards_.Value   = endForwards;
        }
Пример #4
0
        public UnsyncedModifier(IDuration d, Delay delay = null)
        {
            if (d == null)
            {
                Duration = new RandomDuration(1);
            }
            else
            {
                Duration = d;
            }

            if (delay == null)
            {
                Delay = new Delay();
            }
            else
            {
                Delay = delay;
            }
        }
Пример #5
0
        public void Clear()
        {
            if (modifiers_ != null)
            {
                while (modifiers_.Count > 0)
                {
                    DeleteModifier(modifiers_[0]);
                }
            }

            enabled_.Value    = true;
            name_             = null;
            Duration          = new RandomDuration();
            Repeat            = new RandomizableTime(0);
            Delay             = new Delay(new RandomDuration(), false, false);
            halfMove_.Value   = false;
            inFirstHalf_      = true;
            modifiers_        = new List <ModifierContainer>();
            enabledModifiers_ = new List <ModifierContainer>();
        }
Пример #6
0
        public bool FromJSON(J.Node n)
        {
            var o = n.AsObject("StepDelay");

            if (o == null)
            {
                return(false);
            }

            IDuration d = null;

            if (o.HasKey("duration"))
            {
                // migration from v3
                o.Opt <DurationFactory, IDuration>("duration", ref d);
                HalfwayDuration      = d;
                EndForwardsDuration  = new RandomDuration();
                EndBackwardsDuration = new RandomDuration();
            }
            else
            {
                o.Opt <DurationFactory, IDuration>("halfwayDuration", ref d);
                HalfwayDuration = d;

                o.Opt <DurationFactory, IDuration>("endForwardsDuration", ref d);
                EndForwardsDuration = d;

                o.Opt <DurationFactory, IDuration>("endBackwardsDuration", ref d);
                EndBackwardsDuration = d;
            }

            o.Opt("halfway", halfway_);
            o.Opt("endForwards", endForwards_);
            o.Opt("endBackwards", endBackwards_);
            o.Opt("sameDelay", ref sameDelay_);

            return(true);
        }
Пример #7
0
 public AudioModifier(Atom a = null)
 {
     Atom  = a;
     Delay = new RandomDuration(1);
     CheckSource();
 }
Пример #8
0
 private void CopyTo(RandomDuration d, int cloneFlags)
 {
     d.Time = Time.Clone(cloneFlags);
 }
Пример #9
0
 public override List <IWidget> GetWidgets(IDuration d)
 {
     duration_ = d as RandomDuration;
     return(timeWidgets_.GetWidgets());
 }