public Task <Item> UpdateItem(Guid playerId, Guid itemId, ModifiedItem item)
        {
            Player _p = Get(playerId).Result;

            for (int i = 0; i < _p.Items.Count; i++)
            {
                if (_p.Items[i].Id == itemId)
                {
                    _p.Items[i].Value = item.Value;
                    return(Task.FromResult(_p.Items[i]));
                }
            }
            throw new System.ArgumentException("Unable to find given ID.");
        }
Beispiel #2
0
        public async Task <Item> UpdateItem(Guid playerId, Guid itemId, ModifiedItem item)
        {
            Player _p = await Get(playerId);

            for (int i = 0; i < _p.Items.Count; i++)
            {
                if (_p.Items[i].Id == itemId)
                {
                    _p.Items[i].Value = item.Value;
                    ModifiedPlayerInventory _modP = new ModifiedPlayerInventory();
                    _modP.Items = _p.Items;
                    await ModifyInventory(playerId, _modP);

                    return(_p.Items[i]);
                }
            }
            throw new System.ArgumentException("Unable to find given ID.");
        }
 public Task <Item> Modify(Guid playerId, Guid itemId, ModifiedItem item)
 {
     return(_repos.UpdateItem(playerId, itemId, item));
 }
 public Task <Item> Modify(Guid playerId, Guid itemId, ModifiedItem item)
 {
     return(_process.Modify(playerId, itemId, item));
 }