public static Refiner ResolveRefiner(List <Token> Tokens) { Refiner ret = new Refiner(); foreach (var re in Refinerys) { bool ac = false; bool refi = false; foreach (var i in Tokens) { if (i.Name == "Action") { if (re.Actions.Contains(i.Value)) { ac = true; } } if (i.Name == "Refine") { if (re.Refine.Contains(i.Value)) { refi = true; } } } if (ac && refi) { ret = re; break; } } return(ret); }
public static void LoadRefiners() { foreach (var i in Directory.GetFiles(Global.DataSetLocation + "Refinerys")) { if (i.EndsWith(".js")) { FileInfo f = new FileInfo(i); var r = new Refiner() { Name = f.Name.Replace(".js", ""), Code = File.ReadAllText(i) }; r.Invoke(); Refinerys.Add(r); } } }