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