コード例 #1
0
ファイル: BankManager.cs プロジェクト: matigramirez/Imgeneus
        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);
        }
コード例 #2
0
 /// <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));