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

            xDocument.Add(xElement);
            xDocument.Save(filename);
        }
Ejemplo n.º 3
0
 public static void Goingtowall(this Cerwyn cerwyn)
 {
     if (cerwyn.Gender == gender.female)
     {
         throw new Exception("woman can't be knightwatch");
     }
     cerwyn.Profesion     = null;
     north.king.treasury += cerwyn.money;
     cerwyn.money         = 0;
     cerwyn.Weapons.Clear();
     if (cerwyn.Profesion == Profesions.CouncilMember)
     {
         KINGINTHENORTH.CouncilMembers.Remove(cerwyn.Northhuman_Cerwyn);
     }
     HouseCerwyn.Cerwyns_people.Remove(cerwyn);
     if (cerwyn.Profesion == Profesions.soldier)
     {
         HouseCerwyn.Cerwyns_soldiers.Remove(cerwyn);
     }
     CastlesontheWall.Knightswatchpeople.Add(cerwyn.Northhuman_Cerwyn);
 }