void parseConfig() { if (Config.controller_mix != "") { // format like: prio:STC,map:CLASSIC,throttle:THROTTLE string[] parts = Config.controller_mix.Split(','); foreach (string part in parts) { string[] parts2 = part.Split(':'); if (parts2.Length != 2) continue; string type = parts2[0], ctlr = parts2[1]; Controller c = getController(ctlr); Console.WriteLine("adding ctlr {0} as type {1}", ctlr, type); if (type == "prio") addPrioritizer(c); if (type == "map") addMapper(c); if (type == "throttle") addThrottler(c); } foreach (Controller c in m_controllers.Values) addFeedback(c); } else { Controller_ClassicBLESS cb = new Controller_ClassicBLESS(); addFeedback(cb); addThrottler(cb); addPrioritizer(cb); addMapper(cb); } }
Controller getController(string ctlr) { if (m_controllers.ContainsKey(ctlr)) { return(m_controllers[ctlr]); } else { Controller c = null; if (ctlr == "CLASSIC") { c = new Controller_ClassicBLESS(); } if (ctlr == "THROTTLE") { c = new Controller_Throttle(); } if (ctlr == "STC") { c = new Controller_STC(); } if (ctlr == "MIX") { c = new Controller_Mix(); // no practical use for this, but for completeness... } if (ctlr == "SIMPLEMAP") { c = new Controller_SimpleMap(); } m_controllers[ctlr] = c; return(c); } }
Controller getController(string ctlr) { if (m_controllers.ContainsKey(ctlr)) return m_controllers[ctlr]; else { Controller c = null; if (ctlr == "CLASSIC") c = new Controller_ClassicBLESS(); if (ctlr == "THROTTLE") c = new Controller_Throttle(); if (ctlr == "STC") c = new Controller_STC(); if (ctlr == "MIX") c = new Controller_Mix(); // no practical use for this, but for completeness... if (ctlr == "SIMPLEMAP") c = new Controller_SimpleMap(); m_controllers[ctlr] = c; return c; } }
void parseConfig() { if (Config.controller_mix != "") { // format like: prio:STC,map:CLASSIC,throttle:THROTTLE string[] parts = Config.controller_mix.Split(','); foreach (string part in parts) { string[] parts2 = part.Split(':'); if (parts2.Length != 2) { continue; } string type = parts2[0], ctlr = parts2[1]; Controller c = getController(ctlr); Console.WriteLine("adding ctlr {0} as type {1}", ctlr, type); if (type == "prio") { addPrioritizer(c); } if (type == "map") { addMapper(c); } if (type == "throttle") { addThrottler(c); } } foreach (Controller c in m_controllers.Values) { addFeedback(c); } } else { Controller_ClassicBLESS cb = new Controller_ClassicBLESS(); addFeedback(cb); addThrottler(cb); addPrioritizer(cb); addMapper(cb); } }