Exemplo n.º 1
0
 public Problem1WorkflowManager()
 {
     try
     {
         QuestionMap.LoadMap();
         caculatorEngine = new CaculatorEngine();
         questions       = new List <string>();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Exemplo n.º 2
0
        public void Run()
        {
            try
            {
                int count = 0;
                Dictionary <string, QuestionType> questionMap = QuestionMap.GetQuestionMap();
                IList <string> questions = InputLoader.LoadQuestions(ConstStr.QUESTIONFILEPATH);
                IDictionary <MultplePrimKey, int> roads = InputLoader.LoadInputs(ConstStr.INPUTFILEPATH);
                foreach (string key in questionMap.Keys)
                {
                    count++;
                    ICaculator caculator = CaculatorFactory.Create(questionMap[key]);
                    caculator.LoadQuestionAndInput(questions[count - 1], roads);
                    caculatorEngine.AddCaculator(caculator);
                }

                caculatorEngine.Caculate();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }