Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 internal static IList <CVar> ListVars(ListCommandsFilter <CVarCommand> filter)
 {
     return(ListVars(ReusableLists.NextAutoRecycleList <CVar>(), filter));
 }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
 internal static IList<CVar> ListVars(ListCommandsFilter<CVarCommand> filter)
 {
     return ListVars(ReusableLists.NextAutoRecycleList<CVar>(), filter);
 }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
        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;
        }