/// <summary> /// dfs生成交互类型,并将子类型全部实例化 /// </summary> /// <param name="xmlNode">当前类型的节点</param> /// <param name="obj">当前类型实体</param> /// <returns>当前类型实体</returns> public Interactive dfs(XmlNode xmlNode, Interactive obj) { ComplexInteraction complexInteraction = obj as ComplexInteraction; //转型失败 if (complexInteraction == null) { return(obj); } complexInteraction.Interactives = new Interactive[xmlNode.ChildNodes.Count]; for (int i = 0; i < xmlNode.ChildNodes.Count; i++) { complexInteraction.Interactives[i] = CreateInteractiveByXmlNode(xmlNode.ChildNodes[i]); } return(complexInteraction); }
/// <summary> /// 结束特殊交互,并对特殊交互的子交互进行处理 /// </summary> public void EndSuspend(string Return) { ComplexInteraction complexInteraction = m_interactives[InteractivesIndex] as ComplexInteraction; if (complexInteraction == null) { m_suspend = false; //InteractivesIndex++; return; } foreach (Interactive interactive in complexInteraction.Interactives) { if (interactive is If) { If @if = interactive as If; if (@if.m_target.Equals(Return)) { m_interactives.InsertRange(InteractivesIndex + 1, @if.Interactives); } } } InteractivesIndex++; m_suspend = false; }