Пример #1
0
        public async Task <Item> AddItem(Guid playerId, NewItem newItem)
        {
            Player player = await repository.Get(playerId);

            if (player != null)
            {
                Item item = new Item();
                item.Level        = newItem.Level;
                item.Type         = newItem.Type;
                item.CreationDate = newItem.CreationDate;
                ItemCheck(item.Type, player.Level);

                /*
                 * player.Inventory.Add(item);
                 * Player playerNew = await repository.Replace(player);
                 * if (playerNew != null){
                 *  return item;
                 * }
                 */
                return(await repository.PushItem(playerId, item));
            }
            return((Item)null);
        }
Пример #2
0
 public Task <Item> AddAnItem(Guid playerId, NewItem newItem)
 {
     return(processor.AddItem(playerId, newItem));
 }