Пример #1
0
    private void LoadTopic(XmlElement topic, List <Topic> topics)
    {
        Topic tp = new Topic
        {
            TopicName = topic.ChildNodes[0].InnerText
        };
        XmlNodeList xmlNodeList = topic.SelectNodes("Plot");

        if (xmlNodeList != null)
        {
            for (var i = 0; i < xmlNodeList.Count; i++)
            {
                var plot = new Plot
                {
                    NeedLogic        = Parse(xmlNodeList[i].ChildNodes[0].InnerText),
                    NeedTalk         = Parse(xmlNodeList[i].ChildNodes[1].InnerText),
                    NeedAthletics    = Parse(xmlNodeList[i].ChildNodes[2].InnerText),
                    NeedCreativity   = Parse(xmlNodeList[i].ChildNodes[3].InnerText),
                    NeedMaxRound     = Parse(xmlNodeList[i].ChildNodes[6].InnerText),
                    NeedMinRound     = Parse(xmlNodeList[i].ChildNodes[7].InnerText),
                    Place            = xmlNodeList[i].ChildNodes[8].InnerText,
                    NeedRelationShip = Parse(xmlNodeList[i].ChildNodes[9].InnerText)
                };
                plot.AddState(xmlNodeList[i].ChildNodes[4].InnerText);
                plot.AddSlot(xmlNodeList[i].ChildNodes[5].InnerText);
                tp.Plots.Add(plot);
            }
        }

        topics.Add(tp);
    }