public static async Task <List <RawEngine> > Mods(string preloads, bool list = false) { if (list) { var temp = new RawEngine(); await temp.startModsLoader(0, list); return(new List <RawEngine>()); } List <RawEngine> res = new List <RawEngine>(); if (preloads.Contains('[') && preloads.Contains(',')) { string rawModsArg = Helper.Betweenstring(preloads, "[", "]"); string[] allModsArg = rawModsArg.Split(','); foreach (string premod in allModsArg) { try { var engine = new RawEngine(); await engine.startModsLoader(Convert.ToInt32(premod)); res.Add(engine); } catch (Exception ex) { throw new Exception(ex.ToString()); } } } else { try { var eng = new RawEngine(); await eng.startModsLoader(Convert.ToInt32(preloads)); res.Add(eng); } catch (Exception ex) { throw new Exception(ex.ToString()); } } return(res); }
public ThreadController(RawEngine engine) { TargetEngine = engine; }