예제 #1
0
        private void ExtractPikminAndCaptainModels_(
            IModelDirectory <BmdModelFileBundle> parentNode,
            IFileHierarchy fileHierarchy)
        {
            var pikminAndCaptainBaseDirectory =
                fileHierarchy.Root.TryToGetSubdir(
                    @"user\Kando\piki\pikis_designer");

            var bcxFiles =
                pikminAndCaptainBaseDirectory.TryToGetSubdir("motion")
                .Files;

            var captainSubdir =
                pikminAndCaptainBaseDirectory.TryToGetSubdir("orima_model");

            this.ExtractModels_(parentNode.AddSubdir("captains"),
                                captainSubdir.Files,
                                bcxFiles);

            var pikminSubdir =
                pikminAndCaptainBaseDirectory.TryToGetSubdir("piki_model");

            this.ExtractModels_(parentNode.AddSubdir("pikmin"),
                                pikminSubdir.Files,
                                bcxFiles);
        }
예제 #2
0
        private void ExtractAllTreasures_(
            IModelDirectory <BmdModelFileBundle> parentNode,
            IFileHierarchy fileHierarchy)
        {
            var treasureBaseDirectory =
                fileHierarchy.Root.TryToGetSubdir(@"user\Abe\Pellet");

            var baseDirectory = parentNode.AddSubdir("treasures");

            foreach (var locale in treasureBaseDirectory.Subdirs)
            {
                var localeNode = baseDirectory.AddSubdir(locale.Name);

                foreach (var treasure in locale.Subdirs)
                {
                    var treasureNode = localeNode.AddSubdir(treasure.Name);

                    var bmdFiles = treasure.Files.Where(file => file.Extension == ".bmd")
                                   .ToArray();
                    if (bmdFiles.Length > 0)
                    {
                        var bcxFiles =
                            treasure.Files
                            .Where(file => file.Extension == ".bca" ||
                                   file.Extension == ".bck")
                            .ToList();
                        this.ExtractModels_(treasureNode, bmdFiles, bcxFiles);
                    }
                }
            }
        }
예제 #3
0
        private void ExtractLeafBudFlower_(
            IModelDirectory <BmdModelFileBundle> parentNode,
            IFileHierarchy fileHierarchy)
        {
            var leafBudFlowerDirectory =
                fileHierarchy.Root.TryToGetSubdir(
                    @"user\Kando\piki\pikis_designer\happa_model");

            this.ExtractModelsInDirectoryAutomatically_(
                parentNode.AddSubdir("leaf_bud_flower"), leafBudFlowerDirectory);
        }
예제 #4
0
        /// <summary>
        ///   Gets from model/animations in same szs (e.g. user\Kando)
        /// </summary>
        private void ExtractAllFromMergedDirectories_(
            IModelDirectory <BmdModelFileBundle> parentNode,
            IFileHierarchy fileHierarchy)
        {
            foreach (var subdir in fileHierarchy)
            {
                var arcSubdir =
                    subdir.Subdirs.SingleOrDefault(dir => dir.Name == "arc");

                if (arcSubdir != null &&
                    arcSubdir.FilesWithExtension(".bmd").Any())
                {
                    this.ExtractModelsInDirectoryAutomatically_(
                        parentNode.AddSubdir(subdir.Name), arcSubdir);
                }
            }
        }
예제 #5
0
        /// <summary>
        ///   Gets from separate model/animation szs (e.g. Enemies)
        /// </summary>
        private void ExtractAllFromSeparateDirectories_(
            IModelDirectory <BmdModelFileBundle> parentNode,
            IFileHierarchy fileHierarchy)
        {
            foreach (var subdir in fileHierarchy)
            {
                var modelSubdir =
                    subdir.Subdirs.SingleOrDefault(dir => dir.Name == "model");
                var animSubdir =
                    subdir.Subdirs.SingleOrDefault(dir => dir.Name == "anim");

                if (modelSubdir != null && animSubdir != null)
                {
                    var bmdFiles = modelSubdir.Files;
                    var bcxFiles = animSubdir.Files;
                    var btiFiles = subdir.FilesWithExtensionRecursive(".bti").ToArray();

                    this.ExtractModels_(parentNode.AddSubdir(subdir.Name), bmdFiles,
                                        bcxFiles, btiFiles);
                }
            }
        }