Exemple #1
0
 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));
     }
 }
Exemple #2
0
 public virtual void SellEstate(Estate e)
 {
     if (HasEstate(e))
     {
         RemoveEstate(e);
         AddCash(e.Price);
         SellEstateEvent(this, new EstateEventArgs("You have sold the estate.", e));
     }
 }
Exemple #3
0
 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));
     }
 }
Exemple #4
0
 public virtual bool HasEstate(Estate e)
 {
     return _Estates.Contains(e);
 }
Exemple #5
0
 public virtual void AddEstate(Estate e)
 {
     AddEstateEvent(this, new EstateEventArgs("Now you've got a new estate!", e));
     _Estates.Add(e);
 }
Exemple #6
0
 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);
     }
 }
Exemple #7
0
 public virtual bool HasEstate(Estate e)
 {
     return(_Estates.Contains(e));
 }
Exemple #8
0
 public virtual void AddEstate(Estate e)
 {
     AddEstateEvent(this, new EstateEventArgs("Now you've got a new estate!", e));
     _Estates.Add(e);
 }
Exemple #9
0
 public EstateEventArgs(string info, Estate target)
     : base(info)
 {
     Target = target;
 }