public void SellItem(Item i) { //If at a shop, we have the item, and the shop can afford/will be able to resell it if (currentShop && inventory.HasNumberOfItem(i, 1) && currentShop.TryBuyFromPlayer(i)) { inventory.RemoveFromInventory(i, 1); wallet.AddMoney(i.GetPrice()); } }
public override UnityAction Action(Item i, int n, object inventory) { return(new UnityAction(delegate { Inventory inv = inventory as Inventory; inv.RemoveFromInventory(i, n); i.DoItemStuff(); })); }