public static ThpsWad FromList(string filename) { if (!File.Exists(filename)) { throw new Exception($"Not found: {filename}"); } string[] lines = File.ReadAllLines(filename); string path = Path.ChangeExtension(filename, ""); ThpsWad wad = new ThpsWad(); foreach (string s in lines) { if (s != "") { ThpsWadEntry en = new ThpsWadEntry(Path.Combine(path, s.Trim())); wad.Entries.Add(en); } } wad.RecalcOffsets(); return(wad); }
public static ThpsWad FromFolder(string path) { if (!Directory.Exists(path)) { throw new Exception($"Not found: {path}"); } string[] lines = Directory.GetFiles(path); ThpsWad wad = new ThpsWad(); foreach (string s in lines) { if (s != "") { ThpsWadEntry en = new ThpsWadEntry(s); wad.Entries.Add(en); } } wad.RecalcOffsets(); return(wad); }