public void LoadNonPlayerCharacters() { string match = @"^c\d{4}[.]anibnd([.]dcx)?$"; IEnumerable <string> chrFiles = Directory.GetFiles($"{GameDir}chr"); chrFiles = chrFiles.Select(f => Path.GetFileName(f)).Where(f => Regex.IsMatch(f, match)); foreach (string file in chrFiles) { int id = int.Parse(file.Substring(1, 4)); if (InvalidCharacters.Contains(id) || id == 0) { continue; // skip invalid/unused characters and player character (c0000) } Characters[id] = new ChrHandler(id, this); } }
public void LoadPlayerCharacter() { string match = @"^c0000[.]anibnd([.]dcx)?$"; IEnumerable <string> chrFiles = Directory.GetFiles($"{GameDir}chr"); chrFiles = chrFiles.Select(f => Path.GetFileName(f)).Where(f => Regex.IsMatch(f, match)); foreach (string file in chrFiles) { int id = int.Parse(file.Substring(1, 4)); Characters[id] = new ChrHandler(id, this); } for (byte i = 0; i < 10; i++) { StartingClasses[i] = new StartingClass(i, Player, GPARAM, Text); } }