Example #1
0
 public void OverrideWith(TransitionFrame other)
 {
     Position.OverrideWith(other.Position);
     if (Area == null)
     {
         Area = other.Area;
     }
     else
     {
         Area.OverrideWith(other.Area);
     }
     if (TailArea == null)
     {
         TailArea = other.TailArea;
     }
     else
     {
         TailArea = other.TailArea;
     }
 }
Example #2
0
        public void OverrideWith(Transition otherTransition)
        {
            if (otherTransition == null)
            {
                throw new ArgumentException("Overriding argument is not of type " + this.GetType());
            }

            base.OverrideWith(otherTransition);

            PreviousTransitionId = otherTransition.PreviousTransitionId;
            TransitionId         = otherTransition.TransitionId;
            Speed = otherTransition.Speed;

            List <TransitionFrame> overridingFrames = otherTransition.Frames;
            List <TransitionFrame> framesToOverride = Frames;

            if (framesToOverride == null)
            {
                framesToOverride = overridingFrames;
            }
            else if (overridingFrames != null)
            {
                foreach (TransitionFrame overridingFrame in overridingFrames)
                {
                    TransitionFrame frameToOveride = framesToOverride.Find(frameToOverwrite =>
                                                                           overridingFrame.Position.Id == frameToOverwrite.Position.Id &&
                                                                           ((overridingFrame.Area == null && frameToOverwrite.Area == null) ||
                                                                            overridingFrame.Area.Id == frameToOverwrite.Area.Id));

                    if (frameToOveride == null)
                    {
                        //throw new ArgumentException("Transition doesn't contain frame.");
                        return;
                    }

                    frameToOveride.OverrideWith(overridingFrame);
                }
            }
        }