public void GetProperties(Type blockType, List <ITerminalProperty> resultList, Func <ITerminalProperty, bool> collect = null) { if (!typeof(MyTerminalBlock).IsAssignableFrom(blockType)) { return; } MyTerminalControlFactory.GetValueControls(blockType, m_valueControls); foreach (var property in m_valueControls) { if (collect == null || collect(property)) { resultList.Add(property); } } m_valueControls.Clear(); }
public Sandbox.ModAPI.Interfaces.ITerminalProperty GetProperty(string id, Type blockType) { if (!typeof(MyTerminalBlock).IsAssignableFrom(blockType)) { return(null); } MyTerminalControlFactory.GetValueControls(blockType, m_valueControls); foreach (var property in m_valueControls) { if (property.Id == id) { m_valueControls.Clear(); return(property); } } m_valueControls.Clear(); return(null); }