public bool Equals(Realm realm) { // if paramter is null return false; if (realm == null) { return false; } return (realm.Name == _name && realm.Type == _type && realm.Slug == _slug); }
/// <summary> /// Creates a <see cref="Realm"/> object using an <see cref="XElement"/> as data. /// </summary> /// <param name="rlm">The <see cref="XElement"/> containg the realm data.</param> /// <returns>A <see cref="Realm"/> object containing all the data it was passed.</returns> public static Realm ReadRealm(XElement rlm) { Realm r; r = new Realm() { _name = rlm.Element("name").Value, _slug = rlm.Element("slug").Value, _type = (RealmType)Enum.Parse(typeof(RealmType), rlm.Element("type").Value.ToUpper()), _status = bool.Parse(rlm.Element("status").Value), _queue = bool.Parse(rlm.Element("queue").Value), _population = rlm.Element("population").Value }; return r; }