public void GenerateBranch(PreCompiledInstruction instruction)
        {
            int i=0;
            InstructionsTreeNode child;
            bool searching = true;

            this.phraseIndex = instruction.phraseIndices[this.level];

            if (this.level < instruction.Length - 1)
            {
                if (childs.Count > 0)
                {
                    while (i < childs.Count && searching)
                    {
                        child = ((InstructionsTreeNode)childs[i]);

                        if (instruction.phraseIndices[level + 1] == child.phraseIndex)
                        {
                            child.GenerateBranch(instruction);
                            searching = false;
                        }
                        else
                            ++i;
                    }

                    if (searching)
                    {
                        childs.Add(new InstructionsTreeNode(this));
                        ((InstructionsTreeNode)childs[childs.Count - 1]).GenerateBranch(instruction);
                    }
                }
                else
                {
                    childs.Add(new InstructionsTreeNode(this));
                    ((InstructionsTreeNode)childs[childs.Count - 1]).GenerateBranch(instruction);
                }
            }
            else
                this.command = instruction.command;
        }
 public void GenerateBranch(PreCompiledInstruction instruction)
 {
     root.GenerateBranch(instruction);
 }
 public PreCompiledProfile(PreCompiledInstruction[] instructions, CompiledSpeechPhrase[] speechLibrary)
 {
     this.instructions = instructions;
     this.speechLibrary = speechLibrary;
 }