예제 #1
0
        public void AddCombo(ComboAction[] combo)
        {
            List<CTMBranch> current = branches;
            bool found = true;

            foreach (ComboAction c in combo)
            {
                if (found)
                {
                    found = false;
                    foreach (CTMBranch b in current)
                    {
                        if (c == b.Key)
                        {
                            current = b.Branches;
                            found = true;
                            break;
                        }
                    }
                }

                if (!found)
                {
                    CTMBranch b = new CTMBranch(c);

                    current.Add(b);

                    current = b.Branches;
                }
            }

            if (combo.Length > longest) longest = combo.Length;
        }
예제 #2
0
        //recursive portion of finalize
        private CTBranch fillBranch(CTMBranch from)
        {
            if(from.Branches.Count == 0)
                return new CTBranch(from.Key, null);

            CTBranch[] branches = new CTBranch[from.Branches.Count];

            for (int i = 0; i < from.Branches.Count; i++)
                branches[i] = fillBranch(from.Branches[i]);

            return new CTBranch(from.Key, branches);
        }
예제 #3
0
        //recursive portion of finalize
        private CTBranch fillBranch(CTMBranch from)
        {
            if (from.Branches.Count == 0)
            {
                return(new CTBranch(from.Key, null));
            }

            CTBranch[] branches = new CTBranch[from.Branches.Count];

            for (int i = 0; i < from.Branches.Count; i++)
            {
                branches[i] = fillBranch(from.Branches[i]);
            }

            return(new CTBranch(from.Key, branches));
        }
예제 #4
0
        public void AddCombo(ComboAction[] combo)
        {
            List <CTMBranch> current = branches;
            bool             found   = true;

            foreach (ComboAction c in combo)
            {
                if (found)
                {
                    found = false;
                    foreach (CTMBranch b in current)
                    {
                        if (c == b.Key)
                        {
                            current = b.Branches;
                            found   = true;
                            break;
                        }
                    }
                }

                if (!found)
                {
                    CTMBranch b = new CTMBranch(c);

                    current.Add(b);

                    current = b.Branches;
                }
            }

            if (combo.Length > longest)
            {
                longest = combo.Length;
            }
        }