Esempio n. 1
0
        public async Task <Item> CreateItem(Guid id, NewItem item)
        {
            Player player = await IP.GetPlayer(id);

            if (item.Type == 0 && player.level < 3)
            {
                throw new LevelUnderThree("Sword, Type 0 weapon, requires player level 3 or above!");
            }
            Item createeItem = new Item();

            createeItem.id           = Guid.NewGuid();
            createeItem.Level        = item.Level;
            createeItem.Type         = item.Type;
            createeItem.CreationTime = DateTime.Now;

            return(await IP.CreateItem(id, createeItem));
        }
Esempio n. 2
0
 public Task <Item> CreateItem(Guid id, [FromBody] NewItem item)
 {
     return(IP.CreateItem(id, item));
 }