public async Task <Item> ModifyItem(Guid playerid, Guid itemid, ModifiedItem item)
        {
            await Task.CompletedTask;
            Item found = GetItemById(playerid, itemid);

            if (found != null)
            {
                found.Level = item.Level;
            }
            return(found);
        }
Example #2
0
        public async Task <Item> ModifyItem(Guid playerid, Guid id, ModifiedItem item)
        {
            var filter = Builders <Player> .Filter.Eq("Id", playerid);

            var cursor = await collection.FindAsync(filter);

            Player player = cursor.First();

            foreach (Item item2 in player.items)
            {
                if (item2.Id == id)
                {
                    if (item2 != null)
                    {
                        item2.Level = item.Level;
                        await collection.FindOneAndReplaceAsync(filter, player);
                    }
                    return(item2);
                }
            }
            return(null);
        }
Example #3
0
 public Task <Item> Modify(Guid playerid, Guid itemid, [FromBody] ModifiedItem item)
 {
     return(_processor.Modify(playerid, itemid, item));
 }
Example #4
0
 public Task <Item> Modify(Guid playerid, Guid itemid, ModifiedItem item)
 {
     return(_repository.ModifyItem(playerid, itemid, item));
 }