Esempio n. 1
0
        public static void writeinfo(this HouseMormont houseMormont, string filename)
        {
            XDocument xDocument = new XDocument();
            var       sodiers   = HouseMormont.Mormonts_soldiers.Select(soldier => new XElement("name", soldier.Name, new XElement("profession", soldier.Profesion),
                                                                                                new XElement("Age", soldier.age), new XElement("money", soldier.money), new XElement("Gender", soldier.Gender), new XElement("eyescolor", soldier.Eyescolor),
                                                                                                new XElement("Isalive", soldier.Isalive), new XElement("Health", soldier.Health),
                                                                                                new XElement("fight", new XAttribute("Fightskills", soldier.FightSkills), new XAttribute("Durability", soldier.Durability), new XAttribute("Quickness", soldier.Quickness)))).ToList();

            var people = HouseMormont.Mormonts_people.Select(soldier => new XElement("name", soldier.Name, new XElement("profession", soldier.Profesion),
                                                                                     new XElement("Age", soldier.age), new XElement("money", soldier.money), new XElement("Gender", soldier.Gender), new XElement("eyescolor", soldier.Eyescolor),
                                                                                     new XElement("Isalive", soldier.Isalive), new XElement("Health", soldier.Health))).ToList();

            XElement xElement = new XElement("HouseBolton", houseMormont, new XElement("HouseWords", HouseMormont.Words),
                                             new XElement("houseRulers", HouseMormont.houseRulers), new XElement("HousesCapitals", HouseMormont.housesCapital), new XElement("treasury", HouseMormont.Treasury),
                                             new XElement("northlord", new XElement("name", HouseMormont.NorthLord.Name), new XElement("age", HouseMormont.NorthLord.Age),
                                                          new XElement("house", HouseMormont.NorthLord.LordHouse), new XElement("isalive", HouseMormont.NorthLord.Isalive), new XElement("profession", HouseMormont.NorthLord.profesion)),
                                             new XElement("soldiers", sodiers), new XElement("people", people));

            xDocument.Add(xElement);
            xDocument.Save(filename);
        }
 static public void Moneycollector(this HouseMormont houseMormont)
 {
     houseMormont += HouseMormont.Mormonts_people;
 }