private static void DoLoadListCreate(FileInfo target, FileSystemInfo initial, FileSystemInfo shared, FileSystemInfo shared_sound) { var initialContainer = FilesContainer.From(initial.FullName); var sharedContainer = FilesContainer.From(shared.FullName); var sharedSoundContainer = FilesContainer.From(shared_sound.FullName); var initialContainerFiles = initialContainer.GetFiles(); var sharedContainerFiles = sharedContainer.GetFiles(); var sharedSoundContainerFiles = sharedSoundContainer.GetFiles(); LoadListFile.WriteFileNames(target.FullName, initialContainerFiles, sharedContainerFiles, sharedSoundContainerFiles); }
private static void ListLoadList(string loadListLocation) { var entries = LoadListFile.ReadEntries(loadListLocation); foreach (var item in entries) { Console.WriteLine(item); if (item is LoadListAssetEntry asset && asset.Json != null) { Console.Write(" "); Console.WriteLine(asset.Json); } } LoadListFile.ValidateLoadListOrdering(entries); Console.WriteLine("\nStages:"); var stages = entries.OfType <LoadListStageEntry> (); foreach (var item in stages) { Console.WriteLine($"[{item.Index}] {item.Text}"); } Console.WriteLine("\nLoaders:"); var loaders = entries.OfType <LoadListAssetEntry> ().GroupBy(a => a.Loader); foreach (var item in loaders) { Console.WriteLine($"{item.Key}: {item.Count ()} asset(s)"); } Console.WriteLine("\nPAKs:"); var paks = entries.OfType <LoadListAssetEntry> ().GroupBy(a => a.PakName); foreach (var pak in paks) { Console.WriteLine("|"); Console.WriteLine($"+-- {pak.Key}: {pak.Count ()} asset(s)"); var pss = pak.GroupBy(a => a.InternalNamePs); foreach (var ps in pss) { Console.WriteLine($"| +-- <{ps.Key}>: {ps.Count ()}"); var psLoaders = ps.GroupBy(a => a.Loader); foreach (var loader in psLoaders) { Console.WriteLine($"| | +-- {loader.Key}: {loader.Count ()}"); } Console.WriteLine("| |"); } Console.WriteLine("| x"); } Console.WriteLine("x"); }
private static void ListLoadListCompact(string loadListLocation) { var entries = LoadListFile.ReadEntries(loadListLocation); foreach (var item in entries) { switch (item) { case LoadListStartEntry _: case LoadListEndEntry _: Console.WriteLine($"--{item.Type}--"); break; case LoadListStageEntry stage: Console.WriteLine(stage.Text); break; case LoadListAssetEntry asset: Console.WriteLine(asset.InternalName); break; } } }