Пример #1
0
 public static void BecomeCouncilMember(this Stark stark)
 {
     if (stark.Profesion != Profesions.CouncilMember)
     {
         throw new Exception("is'not concil member");
     }
     else
     {
         KINGINTHENORTH.CouncilMembers.Add(stark.Northhuman_stark);
     }
 }
Пример #2
0
        public static void Writeinfo(this Stark stark, string filename)
        {
            XDocument xDocument   = new XDocument();
            var       weaponslist = stark.Weapons.Select(weapons => new XElement("weapon", weapons));
            XElement  xElement    = new XElement("name", stark.Name,
                                                 new XElement("Profesions", stark.Profesion), new XElement("Age", stark.age),
                                                 new XElement("money", stark.money), new XElement("Gender", stark.Gender),
                                                 new XElement("eyescolor", stark.Eyescolor), new XElement("isalive", stark.Isalive), new XElement("Health", stark.Health),
                                                 new XElement("fight", new XAttribute("FightSkills", stark.FightSkills), new XAttribute("Durability", stark.Durability), new XAttribute("Quickness", stark.Quickness)),
                                                 new XElement("weapons", weaponslist));

            xDocument.Add(xElement);
            xDocument.Save(filename);
        }
Пример #3
0
 public static void Goingtowall(this Stark stark)
 {
     if (stark.Gender == gender.female)
     {
         throw new Exception("woman can't be knightwatch");
     }
     stark.Profesion      = null;
     north.king.treasury += stark.money;
     stark.money          = 0;
     stark.Weapons.Clear();
     if (stark.Profesion == Profesions.CouncilMember)
     {
         KINGINTHENORTH.CouncilMembers.Remove(stark.Northhuman_stark);
     }
     HouseStark.Starks_people.Remove(stark);
     if (stark.Profesion == Profesions.soldier)
     {
         HouseStark.Starks_soldiers.Remove(stark);
     }
     CastlesontheWall.Knightswatchpeople.Add(stark.Northhuman_stark);
 }