private static void Load(string filePath) { XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlElement root = doc["replies"]; foreach (XmlElement element in root.GetElementsByTagName("replylist")) { string x_index = element.GetAttribute("index"); if (x_index == null || x_index == String.Empty) { continue; } int index = Convert.ToInt32(x_index, 16); try { ReplyList list = new ReplyList(index, element); m_Table[index] = list; } catch { } } }
public static string RandomReply(int index) { ReplyList list = GetReplyList(index); if (list != null) { return(list.GetRandomPhrase()); } return(""); }