Ejemplo n.º 1
0
 void Buy(IItem item)
 {
     if (Gold < item.Price)
     {
         throw new Exception("Not enough gold to buy this item");
     }
     Gold -= item.Price;
     item.AddToInventory(this);
 }