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

            xDocument.Add(xElement);
            xDocument.Save(filename);
        }
示例#3
0
 public static void Goingtowall(this Bolton bolton)
 {
     if (bolton.Gender == gender.female)
     {
         throw new Exception("woman can't be knightwatch");
     }
     bolton.Profesion     = null;
     north.king.treasury += bolton.money;
     bolton.money         = 0;
     bolton.Weapons.Clear();
     if (bolton.Profesion == Profesions.CouncilMember)
     {
         KINGINTHENORTH.CouncilMembers.Remove(bolton.Northhuman_Bolton);
     }
     HouseBolton.Boltons_people.Remove(bolton);
     if (bolton.Profesion == Profesions.soldier)
     {
         HouseBolton.Boltons_soldiers.Remove(bolton);
     }
     CastlesontheWall.Knightswatchpeople.Add(bolton.Northhuman_Bolton);
 }