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

            xDocument.Add(xElement);
            xDocument.Save(filename);
        }
Exemplo n.º 2
0
 static public void Moneycollector(this HouseBolton houseBolton)
 {
     houseBolton += HouseBolton.Boltons_people;
 }