示例#1
0
        public static void ExtractGames(GameEntryCollection gameEntryCollection, string sourceDirectory, string targetDirectory, bool splitByRegion)
        {
            int currentGameCount    = 1;
            int toCopyTotalArchives = gameEntryCollection.Statistics.TotalArchivesToExtract;

            foreach (GameEntry ge in gameEntryCollection.GameEntries)
            {
                string sourceArchiveFile;
                var    outputDirectory = targetDirectory + "\\" + ((splitByRegion) ? ge.Region.ToString() : "") + "\\" + ge.Title;

                if (ge.IsMultidisc)
                {
                    foreach (MultidiscEntry mde in ge.MultidiscRefs)
                    {
                        sourceArchiveFile = sourceDirectory + "\\" + mde.DiscTitle;
                        Console.Write("{0}/{1} Extracting {2}...", currentGameCount++, toCopyTotalArchives, mde.DiscTitle + ge.ArchiveExtension);
                        ExtractGame(sourceArchiveFile, outputDirectory, ge.ArchiveExtension);
                    }
                }
                else
                {
                    sourceArchiveFile = sourceDirectory + "\\" + ge.Title;
                    Console.Write("{0}/{1} Extracting {2}...", currentGameCount++, toCopyTotalArchives, ge.Title + ge.ArchiveExtension);
                    ExtractGame(sourceArchiveFile, outputDirectory, ge.ArchiveExtension);
                }
            }

            Console.WriteLine("Finished extracting.");
        }
示例#2
0
        public void GenerateCSV(CSVBuilderArguments args)
        {
            Parser parser = new Parser();
            GameEntryCollection gameEntryCollection = new GameEntryCollection(parser.DirectoryToGameEntryList(args.InputDirectory));

            Console.WriteLine("Generating CSV with the following:\n{0}", gameEntryCollection.Statistics.ToString());
            parser.GameEntryListToCSV(gameEntryCollection.GameEntries, args.CsvFilename);
        }
示例#3
0
        public void ExtractAll(ExtractAllArguments args)
        {
            Parser parser = new Parser();
            GameEntryCollection gameEntryCollection = new GameEntryCollection(parser.DirectoryToGameEntryList(args.InputDirectory));

            Console.WriteLine("Extracting the following:\n{0}", gameEntryCollection.Statistics.ToString());
            PromptQuitIfNotKey("\nProceed with extraction?\n", ConsoleKey.Y);
            ExtractGames(gameEntryCollection, args.InputDirectory, args.OutputDirectory, args.Categorize);
        }