Пример #1
0
        public void RecoverStateFromXml(string rawXml)
        {
            var element = XElement.Parse(rawXml);

            Money          = element.AttributeValue("Money", int.Parse);
            MainStageLevel = element.AttributeValue("MainStageLevel", int.Parse);

            var recoveredSpecs = new List <ProgrammerSpec>();

            foreach (var specElement in element.Elements("ProgrammerSpec"))
            {
                var spec = new ProgrammerSpec();
                spec.RecoverStateFromXml(specElement.ToString());
                recoveredSpecs.Add(spec);
            }
            ;

            ClearedStageNames.Clear();
            foreach (var stageElement in element.Elements("ClearedStage"))
            {
                ClearedStageNames.Add(stageElement.AttributeValue("Name"));
            }

            ProgrammerSpecs = recoveredSpecs;
        }
Пример #2
0
        public void RecoverStateFromXml(string rawXml)
        {
            var element = XElement.Parse(rawXml);

            Money = element.AttributeValue("Money", int.Parse);

            var recoveredSpecs = new List <ProgrammerSpec>();

            foreach (var specElement in element.Elements("ProgrammerSpec"))
            {
                var spec = new ProgrammerSpec();
                spec.RecoverStateFromXml(specElement.ToString());
                recoveredSpecs.Add(spec);
            }
            ;

            ProgrammerSpecs = recoveredSpecs;
        }