using System.Collections.Immutable; using System.IO.Compression; namespace BatchOszExtractor.Core; public static class Extract { public static void SelectMaps(SelectionType type, ImmutableList maps, string extractPath) { // both are immutable lists of strings if (type == SelectionType.Selection) { foreach (var map in maps) { using (var archive = ZipFile.Open(map, ZipArchiveMode.Update)) { var file = Path.GetFileName(map); archive.ExtractToDirectory(Path.GetFullPath(Path.Combine(extractPath, file.Remove(file.Length - 4)))); } } } // for a range of beatmaps // TBD else { } } }