Exemplo n.º 1
0
        /// <summary>
        /// Helper method that creates a project tree from the given bundle
        /// </summary>
        /// <param name="bundle">The bundle to create the project tree from</param>
        /// <returns>A project tree that was created from the given bundle</returns>
        public static ProjectTree ProjectTreeFromBundle(Bundle bundle)
        {
            ProjectTree generatedTree = new ProjectTree();

            // Start with the Bundle tree node
            BundleProjectTreeNode root = new BundleProjectTreeNode(bundle);

            generatedTree._rootNode = root;

            // Fill in the animation sheets
            foreach (var sheet in bundle.AnimationSheets)
            {
                AnimationSheetProjectTreeNode sheetNode = new AnimationSheetProjectTreeNode(sheet);
                root.AddChild(sheetNode);

                // Now the animations contained within the sheet
                foreach (var anim in sheet.Animations)
                {
                    AnimationProjectTreeNode animNode = new AnimationProjectTreeNode(anim);
                    sheetNode.AddChild(animNode);
                }
            }

            // Fill in the remaining animations not owned by an animation sheet now
            foreach (var anim in bundle.Animations)
            {
                if (bundle.GetOwningAnimationSheet(anim) == null)
                {
                    AnimationProjectTreeNode animNode = new AnimationProjectTreeNode(anim);
                    root.AddChild(animNode);
                }
            }

            return(generatedTree);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the Bundle class
        /// </summary>
        /// <param name="name">The name for this bundle</param>
        public Bundle(string name)
        {
            Name       = name;
            SaveFile   = "";
            ExportPath = "";

            _animations      = new List <Animation>();
            _animationSheets = new List <AnimationSheet>();

            // Initialize the bundle tree
            BundleProjectTree = ProjectTree.ProjectTreeFromBundle(this);
        }