Пример #1
0
 public void SellBackPurchasedItems(List <PurchasedItem> itemsToSell)
 {
     foreach (PurchasedItem item in itemsToSell)
     {
         var itemValue = GetBuyValueAtCurrentLocation(item);
         campaign.Map.CurrentLocation.StoreCurrentBalance -= itemValue;
         campaign.Money += itemValue;
         PurchasedItems.Remove(item);
     }
 }
        public void SellBackPurchasedItems(List <PurchasedItem> itemsToSell)
        {
            // Check all the prices before starting the transaction
            // to make sure the modifiers stay the same for the whole transaction
            Dictionary <ItemPrefab, int> buyValues = GetBuyValuesAtCurrentLocation(itemsToSell.Select(i => i.ItemPrefab));

            foreach (PurchasedItem item in itemsToSell)
            {
                var itemValue = item.Quantity * buyValues[item.ItemPrefab];
                Location.StoreCurrentBalance -= itemValue;
                campaign.Money += itemValue;
                PurchasedItems.Remove(item);
            }
        }
Пример #3
0
 private void RemoveItem(PurchasedItem item)
 {
     PurchasedItems.Remove(item);
     CartLines.Refresh();
     UpdateView();
 }