/[EmuXPortal]/trunk/EmuXPortal/Api/RomParser.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Api/RomParser.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 26 by william, Wed Apr 4 03:37:37 2012 UTC revision 29 by william, Wed Apr 4 04:13:17 2012 UTC
# Line 9  namespace EmuXPortal.Api Line 9  namespace EmuXPortal.Api
9  {  {
10      public class RomParser      public class RomParser
11      {      {
12          public RomParser(string path, string searchPattern)          public RomParser(IEmuConfig config)
13          {          {
14              List<string> roms = GetRoms(path, searchPattern);              List<string> roms = GetRoms(config.EmuRomPath, config.Extenstions);
15              logger.WriteLine("Found {0} Roms", roms.Count);              logger.WriteLine("Found {0} Roms", roms.Count);
16              this.Roms = GenerateRomConfig(roms);              this.Roms = GenerateRomConfig(roms,config);
17          }          }
18          public List<IRomConfig> Roms { get; private set; }          public List<IRomConfig> Roms { get; private set; }
19          private List<string> GetRoms(string path, string searchPattern)          private List<string> GetRoms(string path, string searchPattern)
# Line 25  namespace EmuXPortal.Api Line 25  namespace EmuXPortal.Api
25              foreach (string rom in roms) { FileInfo fi = new FileInfo(rom); logger.WriteLine("\tAdding: {0}", fi.Name); }              foreach (string rom in roms) { FileInfo fi = new FileInfo(rom); logger.WriteLine("\tAdding: {0}", fi.Name); }
26              return roms;              return roms;
27          }          }
28          private List<IRomConfig> GenerateRomConfig(List<string> roms)          private List<IRomConfig> GenerateRomConfig(List<string> roms, IEmuConfig config)
29          {          {
30              List<IRomConfig> romconfigs = new List<IRomConfig>();              List<IRomConfig> romconfigs = new List<IRomConfig>();
31              logger.WriteLine("Generating Rom Configs");              logger.WriteLine("Generating Rom Configs");
32              foreach (string rom in roms) { romconfigs.Add(RomLoader.Load(rom)); }              foreach (string rom in roms) { romconfigs.Add(RomLoader.Load(rom, config)); }
33              return romconfigs;              return romconfigs;
34          }          }
35      }      }

Legend:
Removed from v.26  
changed lines
  Added in v.29

  ViewVC Help
Powered by ViewVC 1.1.22