Exemplo n.º 1
0
        /// <summary>
        /// Adds an item to a player's bank
        /// </summary>
        public BankItem AddBankItem(byte type, byte typeId, byte count)
        {
            var freeSlot = FindFreeBankSlot();

            // No available slots
            if (freeSlot == -1)
            {
                return(null);
            }

            var bankItem = new BankItem((byte)freeSlot, type, typeId, count);

            BankItems.TryAdd(bankItem.Slot, bankItem);

            _taskQueue.Enqueue(ActionType.SAVE_BANK_ITEM, Client.UserID, DateTime.UtcNow, null, false, bankItem.Type, bankItem.TypeId, bankItem.Count, bankItem.Slot, false);

            return(bankItem);
        }
Exemplo n.º 2
0
 public Item(IDatabasePreloader databasePreloader, BankItem bankItem) : this(databasePreloader, bankItem.Type, bankItem.TypeId, bankItem.Count)
 {
 }