예제 #1
0
        public void Clear(bool RaiseChangedEvent)
        {
            if (RaiseChangedEvent)
            {
                OverlayFileRID     = 0;
                FirstAnimationType = 0;
                ColorTranslation   = 0;
                Effect             = 0;
                Animation          = new AnimationNone();
                Source             = new ObjectID(0);
                Target             = new ObjectID(0);
                Speed        = 0;
                Flags        = 0;
                LightingInfo = new LightingInfo();

                OverlayFile = String.Empty;
            }
            else
            {
                overlayFileRID     = 0;
                firstAnimationType = 0;
                colorTranslation   = 0;
                effect             = 0;
                animation          = new AnimationNone();
                source             = new ObjectID(0);
                target             = new ObjectID(0);
                speed        = 0;
                flags        = 0;
                lightingInfo = new LightingInfo();

                overlayFile = String.Empty;
            }
        }
예제 #2
0
        public override void Clear(bool RaiseChangedEvent)
        {
            base.Clear(RaiseChangedEvent);

            if (RaiseChangedEvent)
            {
                OverlayFileRID     = 0;
                NameRID            = 0;
                LightFlags         = 0;
                LightIntensity     = 0;
                LightColor         = 0;
                FirstAnimationType = 0;
                ColorTranslation   = 0;
                Effect             = 0;

                if (animation != null)
                {
                    animation.PropertyChanged -= OnAnimationPropertyChanged;
                }

                Animation = new AnimationNone();
                animation.PropertyChanged += OnAnimationPropertyChanged;

                Name        = String.Empty;
                OverlayFile = String.Empty;
                Resource    = null;
            }
            else
            {
                overlayFileRID     = 0;
                nameRID            = 0;
                lightFlags         = 0;
                lightIntensity     = 0;
                lightColor         = 0;
                firstAnimationType = 0;
                colorTranslation   = 0;
                effect             = 0;

                if (animation != null)
                {
                    animation.PropertyChanged -= OnAnimationPropertyChanged;
                }

                animation = new AnimationNone();
                animation.PropertyChanged += OnAnimationPropertyChanged;

                name        = String.Empty;
                overlayFile = String.Empty;
                resource    = null;
            }

            flags.Clear(RaiseChangedEvent);
            subOverlays.Clear();
        }
예제 #3
0
        public override void Clear(bool RaiseChangedEvent)
        {
            base.Clear(RaiseChangedEvent);

            if (RaiseChangedEvent)
            {
                OverlayFileRID     = 0;
                NameRID            = 0;
                LightFlags         = 0;
                LightIntensity     = 0;
                LightColor         = 0;
                FirstAnimationType = 0;
                ColorTranslation   = 0;
                Effect             = 0;
                Animation          = new AnimationNone();

                MotionFirstAnimationType = 0;
                MotionColorTranslation   = 0;
                MotionEffect             = 0;
                MotionAnimation          = new AnimationNone();

                Name        = String.Empty;
                OverlayFile = String.Empty;
            }
            else
            {
                overlayFileRID     = 0;
                nameRID            = 0;
                lightFlags         = 0;
                lightIntensity     = 0;
                lightColor         = 0;
                firstAnimationType = 0;
                colorTranslation   = 0;
                effect             = 0;
                animation          = new AnimationNone();

                motionFirstAnimationType = 0;
                motionColorTranslation   = 0;
                motionEffect             = 0;
                motionAnimation          = new AnimationNone();

                name        = String.Empty;
                overlayFile = String.Empty;
            }

            flags.Clear(RaiseChangedEvent);
            subOverlays.Clear();
            motionSubOverlays.Clear();
        }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="RaiseChangedEvent"></param>
 public virtual void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         SideDefServerID = 0;
         Animation       = new AnimationNone();
         Action          = 0;
     }
     else
     {
         sideDefServerID = 0;
         animation       = new AnimationNone();
         action          = 0;
     }
 }
예제 #5
0
        /// <summary>
        /// See managed variant.
        /// </summary>
        /// <param name="Buffer">Referenced pointer to Animation start</param>
        /// <returns>Typed animation class instance or NULL</returns>
        public static unsafe Animation ExtractAnimation(ref byte *Buffer)
        {
            Animation returnValue = null;

            // try to parse the animation
            switch ((AnimationType)Buffer[0])
            {
            case AnimationType.NONE:
                returnValue = new AnimationNone(ref Buffer);
                break;

            case AnimationType.CYCLE:
                returnValue = new AnimationCycle(ref Buffer);
                break;

            case AnimationType.ONCE:
                returnValue = new AnimationOnce(ref Buffer);
                break;
            }

            return(returnValue);
        }
예제 #6
0
        /// <summary>
        /// Extracts an animation from Buffer,
        /// if the 1. read byte signals a known animation type.
        /// </summary>
        /// <param name="Buffer">Buffer to extract from</param>
        /// <param name="StartIndex">Index to start reading</param>
        /// <returns>Typed animation class instance or NULL</returns>
        public static Animation ExtractAnimation(byte[] Buffer, int StartIndex)
        {
            Animation returnValue = null;

            // try to parse the animation
            switch ((AnimationType)Buffer[StartIndex])
            {
            case AnimationType.NONE:
                returnValue = new AnimationNone(Buffer, StartIndex);
                break;

            case AnimationType.CYCLE:
                returnValue = new AnimationCycle(Buffer, StartIndex);
                break;

            case AnimationType.ONCE:
                returnValue = new AnimationOnce(Buffer, StartIndex);
                break;
            }

            return(returnValue);
        }
예제 #7
0
 public virtual void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         ResourceID         = 0;
         HotSpot            = 0;
         FirstAnimationType = 0;
         ColorTranslation   = 0;
         Effect             = 0;
         Animation          = new AnimationNone();
         Name = String.Empty;
     }
     else
     {
         resourceID         = 0;
         hotSpot            = 0;
         firstAnimationType = 0;
         colorTranslation   = 0;
         effect             = 0;
         animation          = new AnimationNone();
         name = String.Empty;
     }
 }
예제 #8
0
        /// <summary>
        /// See managed variant.
        /// </summary>
        /// <param name="Buffer">Referenced pointer to Animation start</param>
        /// <returns>Typed animation class instance or NULL</returns>
        public static unsafe Animation ExtractAnimation(ref byte* Buffer)
        {
            Animation returnValue = null;

            // try to parse the animation
            switch ((AnimationType)Buffer[0])
            {
                case AnimationType.NONE:
                    returnValue = new AnimationNone(ref Buffer);
                    break;

                case AnimationType.CYCLE:
                    returnValue = new AnimationCycle(ref Buffer);
                    break;

                case AnimationType.ONCE:
                    returnValue = new AnimationOnce(ref Buffer);
                    break;
            }

            return returnValue;
        }
예제 #9
0
        /// <summary>
        /// Extracts an animation from Buffer, 
        /// if the 1. read byte signals a known animation type.
        /// </summary>
        /// <param name="Buffer">Buffer to extract from</param>
        /// <param name="StartIndex">Index to start reading</param>
        /// <returns>Typed animation class instance or NULL</returns>
        public static Animation ExtractAnimation(byte[] Buffer, int StartIndex)
        {
            Animation returnValue = null;

            // try to parse the animation
            switch ((AnimationType)Buffer[StartIndex])
            {
                case AnimationType.NONE:
                    returnValue = new AnimationNone(Buffer, StartIndex);
                    break;

                case AnimationType.CYCLE:
                    returnValue = new AnimationCycle(Buffer, StartIndex);
                    break;

                case AnimationType.ONCE:
                    returnValue = new AnimationOnce(Buffer, StartIndex);
                    break;
            }

            return returnValue;
        }
        public void Clear(bool RaiseChangedEvent)
        {
            if (RaiseChangedEvent)
            {
                OverlayFileRID = 0;
                FirstAnimationType = 0;
                ColorTranslation = 0;
                Effect = 0;
                Animation = new AnimationNone();
                Source = new ObjectID(0);
                Target = new ObjectID(0);
                Speed = 0;
                Flags = 0;
                LightFlags = 0;
                LightIntensity = 0;
                LightColor = 0;

                OverlayFile = String.Empty;
            }
            else
            {
                overlayFileRID = 0;
                firstAnimationType = 0;
                colorTranslation = 0;
                effect = 0;
                animation = new AnimationNone();
                source = new ObjectID(0);
                target = new ObjectID(0);
                speed = 0;
                flags = 0;
                lightFlags = 0;
                lightIntensity = 0;
                lightColor = 0;

                overlayFile = String.Empty;
            }
        }
예제 #11
0
        public override void Clear(bool RaiseChangedEvent)
        {
            base.Clear(RaiseChangedEvent);

            if (RaiseChangedEvent)
            {
                OverlayFileRID = 0;
                NameRID = 0;               
                LightFlags = 0;
                LightIntensity = 0;
                LightColor = 0;
                FirstAnimationType = 0;
                ColorTranslation = 0;
                Effect = 0;
                Animation = new AnimationNone();

                MotionFirstAnimationType = 0;
                MotionColorTranslation = 0;
                MotionEffect = 0;
                MotionAnimation = new AnimationNone();

                Name = String.Empty;
                OverlayFile = String.Empty;
            }
            else
            {
                overlayFileRID = 0;
                nameRID = 0;
                lightFlags = 0;
                lightIntensity = 0;
                lightColor = 0;
                firstAnimationType = 0;
                colorTranslation = 0;
                effect = 0;
                animation = new AnimationNone();
                
                motionFirstAnimationType = 0;
                motionColorTranslation = 0;
                motionEffect = 0;
                motionAnimation = new AnimationNone();
                
                name = String.Empty;
                overlayFile = String.Empty;
            }

            flags.Clear(RaiseChangedEvent);
            subOverlays.Clear();
            motionSubOverlays.Clear();
        }
예제 #12
0
        public void SetAnimation()
        {

            ushort group = (cbGroup.SelectedItem == null) ? (ushort)1 : (ushort)((int)cbGroup.SelectedItem);
            ushort low = (cbLow.SelectedItem == null) ? (ushort)1 : (ushort)((int)cbLow.SelectedItem);
            ushort high = (cbHigh.SelectedItem == null) ? (ushort)1 : (ushort)((int)cbHigh.SelectedItem);
            ushort final = (cbFinal.SelectedItem == null) ? (ushort)1 : (ushort)((int)cbFinal.SelectedItem);
            uint period = Convert.ToUInt32(numInterval.Value);
            int groupmax = Program.CurrentFile.FrameSets.Count;

            Animation anim;

            switch (cbType.SelectedIndex)
            {
                // cycle
                case 1:
                    anim = new AnimationCycle(period, low, high);
                    anim.GroupMax = groupmax;
                    break;

                // once
                case 2:
                    anim = new AnimationOnce(period, low, high, final);
                    anim.GroupMax = groupmax;
                    break;

                // none (and others)
                default:
                    anim = new AnimationNone(group);
                    anim.GroupMax = groupmax;
                    break;
            }

            // set color
            Program.RoomObject.FirstAnimationType = AnimationType.TRANSLATION;
            Program.RoomObject.ColorTranslation = Convert.ToByte(cbPalette.SelectedIndex);

            // set cycle anim
            Program.RoomObject.Animation = anim;
        }
 public virtual void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         ResourceID = 0;
         HotSpot = 0;
         FirstAnimationType = 0;
         ColorTranslation = 0;
         Effect = 0;
         Animation = new AnimationNone();
         Name = String.Empty;
     }
     else
     {
         resourceID = 0;
         hotSpot = 0;
         firstAnimationType = 0;
         colorTranslation = 0;
         effect = 0;
         animation = new AnimationNone();
         name = String.Empty;
     }
 }
예제 #14
0
        public override void Clear(bool RaiseChangedEvent)
        {
            base.Clear(RaiseChangedEvent);

            if (RaiseChangedEvent)
            {
                OverlayFileRID = 0;
                NameRID = 0;
                LightFlags = 0;
                LightIntensity = 0;
                LightColor = 0;
                FirstAnimationType = 0;
                ColorTranslation = 0;
                Effect = 0;

                if (animation != null)
                    animation.PropertyChanged -= OnAnimationPropertyChanged;

                Animation = new AnimationNone();
                animation.PropertyChanged += OnAnimationPropertyChanged;

                Name = String.Empty;
                OverlayFile = String.Empty;
                Resource = null;
            }
            else
            {
                overlayFileRID = 0;
                nameRID = 0;
                lightFlags = 0;
                lightIntensity = 0;
                lightColor = 0;
                firstAnimationType = 0;
                colorTranslation = 0;
                effect = 0;

                if (animation != null)
                    animation.PropertyChanged -= OnAnimationPropertyChanged;

                animation = new AnimationNone();
                animation.PropertyChanged += OnAnimationPropertyChanged;

                name = String.Empty;
                overlayFile = String.Empty;
                resource = null;
            }

            flags.Clear(RaiseChangedEvent);                              
            subOverlays.Clear();
        }
예제 #15
0
        /// <summary>
        /// Resets the object to default state/values
        /// </summary>
        /// <param name="RaiseChangedEvent"></param>
        public override void Clear(bool RaiseChangedEvent)
        {
            base.Clear(RaiseChangedEvent);

            if (RaiseChangedEvent)
            {
                Position3D = new V3(0, 0, 0);
                Angle = 0.0f;
                MotionFirstAnimationType = 0;
                MotionColorTranslation = 0;
                MotionEffect = 0;

                if (motionAnimation != null)
                    motionAnimation.PropertyChanged -= OnMotionAnimationPropertyChanged;

                MotionAnimation = new AnimationNone();
                MotionAnimation.PropertyChanged += OnMotionAnimationPropertyChanged;

                motionSubOverlays.Clear();
                
                IsMoving = false;
                IsTarget = false;
                IsHighlighted = false;
                VerticalSpeed = 0.0f;
            }
            else
            {
                position3D = new V3(0, 0, 0);
                angle = 0.0f;
                motionFirstAnimationType = 0;
                motionColorTranslation = 0;
                motionEffect = 0;

                if (motionAnimation != null)
                    motionAnimation.PropertyChanged -= OnMotionAnimationPropertyChanged;

                motionAnimation = new AnimationNone();
                motionAnimation.PropertyChanged += OnMotionAnimationPropertyChanged;

                motionSubOverlays.Clear();
                
                isMoving = false;
                isTarget = false;
                isHighlighted = false;
                verticalSpeed = 0.0f;
            }
        }