/[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

--- trunk/EmuXPortal/Api/RomParser.cs	2012/04/04 03:37:37	26
+++ trunk/EmuXPortal/Api/RomParser.cs	2012/04/04 04:13:17	29
@@ -9,11 +9,11 @@
 {
     public class RomParser
     {
-        public RomParser(string path, string searchPattern)
+        public RomParser(IEmuConfig config)
         {
-            List<string> roms = GetRoms(path, searchPattern);
+            List<string> roms = GetRoms(config.EmuRomPath, config.Extenstions);
             logger.WriteLine("Found {0} Roms", roms.Count);
-            this.Roms = GenerateRomConfig(roms);
+            this.Roms = GenerateRomConfig(roms,config);
         }
         public List<IRomConfig> Roms { get; private set; }
         private List<string> GetRoms(string path, string searchPattern)
@@ -25,11 +25,11 @@
             foreach (string rom in roms) { FileInfo fi = new FileInfo(rom); logger.WriteLine("\tAdding: {0}", fi.Name); }
             return roms;
         }
-        private List<IRomConfig> GenerateRomConfig(List<string> roms)
+        private List<IRomConfig> GenerateRomConfig(List<string> roms, IEmuConfig config)
         {
             List<IRomConfig> romconfigs = new List<IRomConfig>();
             logger.WriteLine("Generating Rom Configs");
-            foreach (string rom in roms) { romconfigs.Add(RomLoader.Load(rom)); }
+            foreach (string rom in roms) { romconfigs.Add(RomLoader.Load(rom, config)); }
             return romconfigs;
         }
     }

 

  ViewVC Help
Powered by ViewVC 1.1.22