Ejemplo n.º 1
0
 private static CrewMemberData LoadCrewMember(XmlNode node)
 {
     string cName = "";
     CrewMemberData.CrewClass cClass = CrewMemberData.CrewClass.None;
     int atk = 0;
     int def = 0;
     int spd = 0;
     int level = 0;
     int exp = 0;
     foreach (XmlNode nn in node.ChildNodes)
     {
         switch (nn.Name)
         {
             case "Name": cName = nn.InnerText; break;
             case "Class": cClass = CrewMemberData.getTypeFromString(nn.InnerText); break;
             case "Atk": atk = Int32.Parse(nn.InnerText); break;
             case "Def": def = Int32.Parse(nn.InnerText); break;
             case "Spd": spd = Int32.Parse(nn.InnerText); break;
             case "Level": level = Int32.Parse(nn.InnerText); break;
             case "Exp": exp = Int32.Parse(nn.InnerText); break;
         }
     }
     CrewMemberData data = new CrewMemberData(cName, atk, def, spd, 100, null, null);
     data.setCrewClass(cClass);
     data.setExp(exp);
     data.setLevel(level);
     return data;
 }