public IAPItem GetItemByID(string id) { for (int i = 0; i < AvailableItems.Count; ++i) { IAPItem item = AvailableItems[i]; if (item.ItemID == id) { return(item); } } throw new InvalidOperationException("Cannot find an item with that ID"); }
private void RewardItem(string itemID) { IAPItem item = GetItemByID(itemID); item.Award(); }