Ejemplo n.º 1
0
        public static void writeinfo(this HouseGlover houseGlover, string filename)
        {
            XDocument xDocument = new XDocument();
            var       sodiers   = HouseGlover.Glovers_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 = HouseGlover.Glovers_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", houseGlover, new XElement("HouseWords", HouseGlover.Words),
                                             new XElement("houseRulers", HouseGlover.houseRulers), new XElement("HousesCapitals", HouseGlover.housesCapital), new XElement("treasury", HouseGlover.Treasury),
                                             new XElement("northlord", new XElement("name", HouseGlover.NorthLord.Name), new XElement("age", HouseGlover.NorthLord.Age),
                                                          new XElement("house", HouseGlover.NorthLord.LordHouse), new XElement("isalive", HouseGlover.NorthLord.Isalive), new XElement("profession", HouseGlover.NorthLord.profesion)),
                                             new XElement("soldiers", sodiers), new XElement("people", people));

            xDocument.Add(xElement);
            xDocument.Save(filename);
        }
Ejemplo n.º 2
0
 static public void Moneycollector(this HouseGlover houseGlover)
 {
     houseGlover += HouseGlover.Glovers_people;
 }