private void ShowDialogue(XElement eventArgs) { if (eventArgs.Element("dialogue") != null) { int diaCount = eventArgs.Element("dialogue").Elements("oneDial").Count(); Dialogue[] dials = new Dialogue[diaCount]; for (int i = 0; i < diaCount; i++) { string name = eventArgs.Element("dialogue").Elements("oneDial").ElementAt(i).Element("name").Value; string content = eventArgs.Element("dialogue").Elements("oneDial").ElementAt(i).Element("content").Value; dials[i] = new Dialogue(name, content); } User.AddEvent(EventLogic.OpenDialogue, new MotaEventArgs(dials)); } }
/// <summary> /// 以作用字符串创建魔塔事件参数实例 /// </summary> /// <param name="dialogue">对话数组</param> public MotaEventArgs(Dialogue[] dialogue, EffectType type = EffectType.Default) { this.Messages = dialogue; Method = type; }