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 PlayerMiesmiesException();
            }
            Item newItem = new Item();

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