/[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/08/23 02:10:16	107
+++ trunk/EmuXPortal/Api/RomParser.cs	2012/08/23 04:13:19	112
@@ -12,19 +12,19 @@
     public class RomParser :IDisposable
     {
         private IEmuConfig Config { get; set; }
-        public RomParser(IEmuConfig config)
+        public RomParser(logger log, IEmuConfig config)
         {
             this.Config = config;
-            List<IRomConfigPair> roms = GetRoms();
-            logger.WriteLine("Found {0} Roms", roms.Count);
-            this.Roms = GenerateRomConfig(roms,config);
+            List<IRomConfigPair> roms = GetRoms(log);
+            log.WriteLine("Found {0} Roms", roms.Count);
+            this.Roms = GenerateRomConfig(log, roms,config);
         }
         public List<IRomConfig> Roms { get; private set; }
-        private List<IRomConfigPair> GetRoms()
+        private List<IRomConfigPair> GetRoms(logger log)
         {
             if (Config.HasExternalConfigs) { return GetRomsEX(); }
             string path = Config.EmuRomPath; string searchPattern = Config.Extenstions;
-            logger.WriteLine("Searching for Roms in Folder: {0}", path);
+            log.WriteLine("Searching for Roms in Folder: {0}", path);
             Predicate<string> rom_predicate = new Predicate<string>(delegate(string t)
                 {
                     string search_exts = searchPattern.Replace("*", "");
@@ -64,11 +64,11 @@
             return roms;
         }
 
-        private List<IRomConfig> GenerateRomConfig(List<IRomConfigPair> roms, IEmuConfig config)
+        private List<IRomConfig> GenerateRomConfig(logger log, List<IRomConfigPair> roms, IEmuConfig config)
         {
             List<IRomConfig> romconfigs = new List<IRomConfig>();
-            logger.WriteLine("Generating Rom Configs");
-            foreach (IRomConfigPair rom in roms) { romconfigs.Add(RomLoader.Load(rom.RomFile, rom.RomConfig)); }
+            log.WriteLine("Generating Rom Configs");
+            foreach (IRomConfigPair rom in roms) { romconfigs.Add(RomLoader.Load(log, rom.RomFile, rom.RomConfig)); }
             return romconfigs;
         }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22