internal static IList <CCommand> ListCommands(IList <CCommand> outList, ListCommandsFilter <CCommand> filter) { if (filter == null) { throw new NullReferenceException("Filter is null"); } foreach (CCommand command in m_commands) { if (filter(command)) { outList.Add(command); } } return(outList); }
internal static IList <CVar> ListVars(IList <CVar> outList, ListCommandsFilter <CVarCommand> filter) { if (filter == null) { throw new NullReferenceException("Filter is null"); } foreach (CCommand cmd in m_commands) { CVarCommand varCmd = cmd as CVarCommand; if (varCmd != null && filter(varCmd)) { outList.Add(varCmd.cvar); } } return(outList); }
internal static bool Unregister(ListCommandsFilter <CCommand> filter) { bool unregistered = false; for (LinkedListNode <CCommand> node = m_commands.First; node != null;) { LinkedListNode <CCommand> next = node.Next; CCommand cmd = node.Value; if (filter(cmd)) { unregistered |= Unregister(cmd); } node = next; } return(unregistered); }
internal static IList <CVar> ListVars(ListCommandsFilter <CVarCommand> filter) { return(ListVars(ReusableLists.NextAutoRecycleList <CVar>(), filter)); }
internal static IList<CVar> ListVars(IList<CVar> outList, ListCommandsFilter<CVarCommand> filter) { if (filter == null) { throw new NullReferenceException("Filter is null"); } foreach (CCommand cmd in m_commands) { CVarCommand varCmd = cmd as CVarCommand; if (varCmd != null && filter(varCmd)) { outList.Add(varCmd.cvar); } } return outList; }
internal static IList<CVar> ListVars(ListCommandsFilter<CVarCommand> filter) { return ListVars(ReusableLists.NextAutoRecycleList<CVar>(), filter); }
internal static IList<CCommand> ListCommands(IList<CCommand> outList, ListCommandsFilter<CCommand> filter) { if (filter == null) { throw new NullReferenceException("Filter is null"); } foreach (CCommand command in m_commands) { if (filter(command)) { outList.Add(command); } } return outList; }
internal static bool Unregister(ListCommandsFilter<CCommand> filter) { bool unregistered = false; for (LinkedListNode<CCommand> node = m_commands.First; node != null;) { LinkedListNode<CCommand> next = node.Next; CCommand cmd = node.Value; if (filter(cmd)) { unregistered |= Unregister(cmd); } node = next; } return unregistered; }