public static void BecomeCouncilMember(this Reed reed) { if (reed.Profesion != Profesions.CouncilMember) { throw new Exception("is'not concil member"); } else { KINGINTHENORTH.CouncilMembers.Add(reed.Northhuman_Reed); } }
public static void Writeinfo(this Reed reed, string filename) { XDocument xDocument = new XDocument(); var weaponslist = reed.Weapons.Select(weapons => new XElement("weapon", weapons)); XElement xElement = new XElement("name", reed.Name, new XElement("Profesions", reed.Profesion), new XElement("Age", reed.age), new XElement("money", reed.money), new XElement("Gender", reed.Gender), new XElement("eyescolor", reed.Eyescolor), new XElement("isalive", reed.Isalive), new XElement("Health", reed.Health), new XElement("fight", new XAttribute("FightSkills", reed.FightSkills), new XAttribute("Durability", reed.Durability), new XAttribute("Quickness", reed.Quickness)), new XElement("weapons", weaponslist)); xDocument.Add(xElement); xDocument.Save(filename); }
public static void Goingtowall(this Reed reed) { if (reed.Gender == gender.female) { throw new Exception("woman can't be knightwatch"); } reed.Profesion = null; north.king.treasury += reed.money; reed.money = 0; reed.Weapons.Clear(); if (reed.Profesion == Profesions.CouncilMember) { KINGINTHENORTH.CouncilMembers.Remove(reed.Northhuman_Reed); } HouseReed.Reeds_people.Remove(reed); if (reed.Profesion == Profesions.soldier) { HouseReed.Reeds_soldiers.Remove(reed); } CastlesontheWall.Knightswatchpeople.Add(reed.Northhuman_Reed); }