public virtual void RemoveEstate(Estate e) { if (HasEstate(e)) { e.Owner = null; _Estates.Remove(e); RemoveEstateEvent(this, new EstateEventArgs("You have lost the estate.", e)); } }
public virtual void SellEstate(Estate e) { if (HasEstate(e)) { RemoveEstate(e); AddCash(e.Price); SellEstateEvent(this, new EstateEventArgs("You have sold the estate.", e)); } }
public virtual void BuyEstate(Estate e) { if (HasEstate(e)) { return; } if (!SpendCash(e.Price)) { return; } else { e.Owner = this; BuyEstateEvent(this, new EstateEventArgs("Congratulations! You have bought this estate!", e)); } }
public virtual bool HasEstate(Estate e) { return _Estates.Contains(e); }
public virtual void AddEstate(Estate e) { AddEstateEvent(this, new EstateEventArgs("Now you've got a new estate!", e)); _Estates.Add(e); }
internal static void NewInstanceFromXml(XmlNode detail, ref Place result, int id) { if (detail.Name != "Estate") { return; } result = new Estate(id); Estate obj = result as Estate; obj.Name = detail.SelectSingleNode("name").InnerText; if ((detail.ParentNode as XmlElement).GetAttribute("continue") == "true") { obj.Owner = Game.Players[int.Parse(detail.SelectSingleNode("owner_id").InnerText)]; obj.Level = int.Parse(detail.SelectSingleNode("level").InnerText); } }
public virtual bool HasEstate(Estate e) { return(_Estates.Contains(e)); }
public EstateEventArgs(string info, Estate target) : base(info) { Target = target; }