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