/// <summary> /// Returns item level /// </summary> /// <param name="shopItemModel"></param> /// <returns>Returns 0 if item is not unlocked</returns> internal int GetItemLevel(IShopItemModel shopItemModel) { if (items.ContainsKey(shopItemModel.GetID())) { return(items[shopItemModel.GetID()].itemLevel); } else { return(0); } }
private void BuyItem(IShopItemModel shopItemModel) { int itemLevel = inventory.GetItemLevel(shopItemModel); playerCurrency.Spend(CurrencyType.Gold, shopItemModel.GetGoldCost(itemLevel)); Debug.Log("Item " + shopItemModel.GetID() + " was bought"); }