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; }
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; }