internal void SetLimits(InventoryCollectibleLimit limits) { if (limits.CollectibleCounts != null) { foreach (var limit in limits.CollectibleCounts) { InventoryItemState item; if (!m_inventoryItems.TryGetValue(limit.CollectibleId, out item)) { item = new InventoryItemState { CollectibleId = limit.CollectibleId, Limit = int.MaxValue }; m_inventoryItems[item.CollectibleId] = item; } item.Limit = MathHelper.ApplyNumericalOperator(limits.Operator, item.Limit.GetValueOrDefault(), limit.Count); } } }
internal void SetLimits(WalletCurrencyLimit limits) { if (limits.CurrencyCounts != null) { foreach (var limit in limits.CurrencyCounts) { WalletCurrencyItem item; if (!m_itemDict.TryGetValue(limit.Currency, out item)) { item = new WalletCurrencyItem { CurrencyName = limit.Currency, Limit = int.MaxValue }; m_itemDict[item.CurrencyName] = item; } item.Limit = MathHelper.ApplyNumericalOperator(limits.Operator, item.Limit, limit.Count); } } }