Beispiel #1
0
        public AnimationChainList ToAnimationChainList(string contentManagerName, bool throwError)
        {
            mToRuntimeErrors.Clear();

            AnimationChainList list = new AnimationChainList();

            list.FileRelativeTextures = FileRelativeTextures;
            list.TimeMeasurementUnit  = TimeMeasurementUnit;
            list.Name = mFileName;

            string oldRelativeDirectory = FileManager.RelativeDirectory;

            try
            {
                if (this.FileRelativeTextures)
                {
                    FileManager.RelativeDirectory = FileManager.GetDirectory(mFileName);
                }

                foreach (AnimationChainSave animationChain in this.AnimationChains)
                {
                    try
                    {
                        Gum.Graphics.Animation.AnimationChain newChain = null;

                        newChain = animationChain.ToAnimationChain(contentManagerName, this.TimeMeasurementUnit, this.CoordinateType);

                        newChain.mIndexInLoadedAchx = list.Count;

                        newChain.ParentAchxFileName = mFileName;

                        list.Add(newChain);
                    }
                    catch (Exception e)
                    {
                        mToRuntimeErrors.Add(e.ToString());
                        if (throwError)
                        {
                            throw new Exception("Error loading AnimationChain", e);
                        }
                    }
                }
            }
            finally
            {
                FileManager.RelativeDirectory = oldRelativeDirectory;
            }

            return(list);
        }
Beispiel #2
0
        public AnimationChainList Clone()
        {
            AnimationChainList newList = new AnimationChainList(this.Count);

            foreach (AnimationChain chain in this)
            {
                newList.Add(chain.Clone());
            }

            newList.mName = mName;
            newList.mFileRelativeTextures = mFileRelativeTextures;
            newList.mTimeMeasurementUnit  = mTimeMeasurementUnit;

            return(newList);
        }
Beispiel #3
0
 bool IEquatable <AnimationChainList> .Equals(AnimationChainList other)
 {
     return(this == other);
 }