Beispiel #1
0
        private static void ReadGimmick(Options options)
        {
            using (var xb2Fs = new Xb2Fs(options.Xb2Dir))
            {
                if (options.Xb2Dir == null)
                {
                    throw new NullReferenceException("Must specify XB2 Directory.");
                }
                if (options.Output == null)
                {
                    throw new NullReferenceException("No output path was specified.");
                }
                if (!Directory.Exists(options.Xb2Dir))
                {
                    throw new DirectoryNotFoundException($"{options.Xb2Dir} is not a valid directory.");
                }

                BdatCollection tables = GetBdatCollection(xb2Fs, false);

                MapInfo[] gimmicks = ReadGmk.ReadAll(xb2Fs, tables);
                ExportMap.ExportCsv(gimmicks, options.Output);

                ExportMap.Export(xb2Fs, gimmicks, options.Output);
            }
        }
Beispiel #2
0
        private static void ReadGimmick(Options options)
        {
            using (var archive = new FileArchive(options.ArhFilename, options.ArdFilename))
            {
                if (options.ArdFilename == null)
                {
                    throw new NullReferenceException("Archive must be specified");
                }
                if (options.Output == null)
                {
                    throw new NullReferenceException("No output file was specified.");
                }

                BdatCollection tables = GetBdatCollection(options);

                var gimmicks = ReadGmk.ReadAll(archive, tables);
                ExportMap.ExportCsv(gimmicks, options.Output);

                ExportMap.Export(archive, gimmicks, options.Output);
            }
        }
Beispiel #3
0
        public static void GenerateBdatHtml(IFileSystem fs, string outDir, IProgressReport progress)
        {
            var bdats = new BdatTables(fs, true, progress);
            BdatStringCollection tablesStr = DeserializeStrings.DeserializeTables(bdats, progress);

            Metadata.ApplyMetadata(tablesStr);
            HtmlGen.PrintSeparateTables(tablesStr, Path.Combine(outDir, BdatDir), progress);
            JsonGen.PrintAllTables(tablesStr, Path.Combine(outDir, JsonDir), progress);

            BdatCollection tables = Deserialize.DeserializeTables(bdats, progress);

            string dataDir = Path.Combine(outDir, DataDir);

            progress.SetTotal(0);
            progress.LogMessage("Creating salvaging tables");
            Directory.CreateDirectory(dataDir);
            string salvaging = SalvagingTable.Print(tables);

            File.WriteAllText(Path.Combine(dataDir, "salvaging.html"), salvaging);

            progress.LogMessage("Creating enemy tables");
            using (var writer = new StreamWriter(Path.Combine(dataDir, "enemies.csv")))
            {
                Enemies.PrintEnemies(tables, writer);
            }

            progress.LogMessage("Creating achievement tables");
            using (var writer = new StreamWriter(Path.Combine(dataDir, "achievements.csv")))
            {
                Achievements.PrintAchievements(tables, writer);
            }

            string gmkDir = Path.Combine(outDir, GmkDir);

            MapInfo[] gimmicks = ReadGmk.ReadAll(fs, tables, progress);
            progress.LogMessage("Writing map info and gimmick data");
            ExportMap.ExportCsv(gimmicks, gmkDir);
        }