public ESProvider(FactParser factParser, RuleParser ruleParser) { FactParser = factParser; RuleParser = ruleParser; FactRepository = FactParser.FactRepository; RuleRepository = RuleParser.RuleRepository; Answers = new Dictionary <string, bool>(); errorMessage = "shit happens."; }
public ESProvider(FactParser factParser, RuleParser ruleParser) { factRepo = factParser.GetFactRepository(); ruleRepo = ruleParser.GetRuleRepository(); this.factParser = factParser; this.ruleParser = ruleParser; myenumrule = ruleRepo.GetEnumerator(); myenumfact = factRepo.GetEnumerator(); }
static void Main(string[] args) { FactParser factParser = new FactParser("facts.xml"); RuleParser ruleParser = new RuleParser("rules.xml"); ESProvider provider = new ESProvider(factParser, ruleParser); /* foreach (var fact in factParser.FactRepository.Facts) * { * System.Console.WriteLine(fact.Description); * } */ provider.CollectAnswers(); /* Console.Write("Enter an ID: "); * Console.WriteLine(provider.GetAnswerByQuestion(Console.ReadLine())); */ Console.WriteLine(provider.Evaluate()); }