private static void RunOptionsAndReturnExitCode(Options opts) { Dictionary <String, Model> models = ConfigLoader.readModels(opts.ModelFile); RubikDataProcessor processor = new RubikDataProcessor(models, opts.OutputFolder); using (StreamReader sr = new RubikDataReader(opts.DataFile)) { string line; while ((line = sr.ReadLine()) != null) { string colorCode = sr.ReadLine(); processor.Process(line, colorCode); } } }
public static Dictionary <String, Model> readModels(string filename) { Dictionary <String, Model> models = new Dictionary <string, Model>(); using (StreamReader sr = new RubikDataReader(filename)) { Model model = readModel(sr); while (model != null) { models.Add(model.Name, model); model = readModel(sr); } } return(models); }