public void Init(int ownerId, IEnumerable<DbBankItem> items) { _ownerId = ownerId; foreach (var bankItem in items.Select(bi => new BankItem(bi))) BankItems.TryAdd(bankItem.Slot, bankItem); }
/// <summary> /// Gets the bank item with the specified name. /// </summary> /// <param name="name">The name of the item to get.</param> /// <returns>The item with the specified name or null if it doesn't exist.</returns> public InventoryItem GetItemByName(string name) => BankItems.Find(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));