Exemplo n.º 1
0
        public Task <Item> UpdateItem(Guid id, Guid itemId, ModifiedItem item)
        {
            Player plr = players.Find(x => x.Id == id);
            Item   itm = plr.items.Find(x => x.Id == itemId);

            itm.level = item.level;
            return(Task.FromResult(itm));
            //throw new NotImplementedException();
        }
Exemplo n.º 2
0
        public async Task <Item> UpdateItem(Guid id, Guid itemId, ModifiedItem item)
        {
            FilterDefinition <Player> filter = Builders <Player> .Filter.Eq("_id", id);

            Player plr = await _collection.Find(filter).FirstAsync();

            Item itm = plr.items.Find(x => x.Id == itemId);

            itm.level = item.level;
            return(itm);
        }
Exemplo n.º 3
0
 public Task <Item> Modify(Guid playerid, Guid itemid, ModifiedItem Item)
 {
     return(repo.UpdateItem(playerid, itemid, Item));
 }