/// <summary> /// Gets all the upgrades for the virtual good with the given <c>goodItemId</c>. /// </summary> /// <param name="goodItemId">Item id.</param> /// <returns>All upgrades for virtual good with the given id.</returns> public static List <UpgradeVG> GetUpgradesForVirtualGood(string goodItemId) { SoomlaUtils.LogDebug(TAG, "Trying to fetch upgrades of a good with itemId: " + goodItemId); List <UpgradeVG> upgrades; if (GoodsUpgrades != null && GoodsUpgrades.TryGetValue(goodItemId, out upgrades)) { return(upgrades); } return(null); }
/// <summary> /// Gets the last upgrade for the virtual good with the given <c>goodItemId</c>. /// </summary> /// <param name="goodItemId">item id</param> /// <returns>last upgrade for virtual good with the given id</returns> public static UpgradeVG GetLastUpgradeForVirtualGood(string goodItemId) { SoomlaUtils.LogDebug(TAG, "Trying to fetch last upgrade of a good with itemId: " + goodItemId); List <UpgradeVG> upgrades; if (GoodsUpgrades != null && GoodsUpgrades.TryGetValue(goodItemId, out upgrades)) { return(upgrades.FirstOrDefault(up => string.IsNullOrEmpty(up.NextItemId))); } return(null); }