Esempio n. 1
0
        public Task <Item> Create(Guid playerid, NewItem item)
        {
            Player player = _repository.GetPlayer(playerid).Result;

            if (player.Level < 3 && item.Type == "Sword")
            {
                throw new PlayerException();
            }
            Item newItem = new Item();

            newItem.Name         = item.Name;
            newItem.Id           = Guid.NewGuid();
            newItem.CreationTime = item.CreationDate;
            return(_repository.CreateItem(playerid, newItem));
        }
Esempio n. 2
0
 public Task <Item> Create(Guid playerid, [FromBody] NewItem item)
 {
     return(_processor.Create(playerid, item));
 }